Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to represent lengths in XML (feet, inches etc)
Message
De
15/12/2003 16:56:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/12/2003 16:37:43
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00859083
Message ID:
00859325
Vues:
18
>Randomly, I had to do something very similar for measurements (weight and volume, ie pounds, ounces, grams, gallons, quarts, cups, etc.). I was saving mine into a MySQL database, and outputting to everything.
>
>Basically how I ended up doing it was storing it to the metric measurements (grams/liters). That way you don't have to figure out (in your case) "8 miles, 6 yards, 2 feet, 9.75 inches-- it's just... well, I have no idea what that is in metric, but assume a number like "47533.008m", and from that all you have to do is a stack of mods and divs, and you should be able to pull out your values properly (in either units...)
>
>Doubt this'll help, but it got me out of a couple minutes of work! =)
>Mark

For storing amounts in a DBF, I used an amount, and a unit. This is simpler in SI than in the imperial units, where it is customary to indicate measurements as "1 foot, 2 inches". In Bolivia, of course, we use mainly SI - although some items are purchased in feet, square feet, gallons, and the like.

Anyway, for the conversions, I had a conversion table, for converting from one unit to another, and a lookup function for this table.

I don't whether any of this would be different in XML, though.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform