converting metrics

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

converting metrics

Post by herbwords »

Hi,

Can anyone let me know how to deal with switching back and forth from grams to kilos and mL to liters when deductions and additions are made?

Thanks,

Patrick
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: converting metrics

Post by Klaus »

Hi Patrcik,

hmm, 1000 grams/milliliter = 1 kilo/liter etc.
What am I missing? 8)


Best

Klaus
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10508
Joined: Wed May 06, 2009 2:28 pm

Re: converting metrics

Post by dunbarx »

Are you asking for a function that converts these things? What do you mean by "deductions"? If you are in one unit of measure do you need to change when adding or subtracting quanitities? Example: 1 liter - 10 mL = either 0.99 liter or 990 mL.

Is this it?

Write back...

Craig Newman
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: converting metrics

Post by herbwords »

Hi Craig,

This is a tough thing for the US. I understand what you mean by shifting the decimal point and how simple it is. I'm trying to change labels also so they say either mL or L or g and kg. People in the US have a very difficult time if you say .5 kg instead of 500 grams. So I'm trying to put grams for everything to 999 grams and mL to 999mL in the labels.
So I was wanting an example of how someone in a metric using country would deal with this.

Example:
The program I'm developing asks what is the weight? If it weighs .256 Kg they want to write 256 grams I would rather leave every thing in liters and kilos but if there's any reasonable way of helping them understand I will try to accommidate. Hope this makes sense?

Thanks,

Patrick
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10508
Joined: Wed May 06, 2009 2:28 pm

Re: converting metrics

Post by dunbarx »

I would have thought that even in a metric country a value of 250 mL would be written just like that. Certainly all chemical glassware is labeled that way, and up to about 3000 mL the label is kept in mL.

Above a liter (or kilo) in general, though, I guess you would say "1.25L" or "1.25Kg".

One more thought might be to append the other label:

250 ml = 1.25L (1250mL) or
.250 gms = 0.25Kg (250g)

Craig Newman
Post Reply