converting metrics

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

converting metrics

Post by herbwords » Sun Mar 25, 2012 5:26 pm

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: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: converting metrics

Post by Klaus » Sun Mar 25, 2012 5:45 pm

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: 10356
Joined: Wed May 06, 2009 2:28 pm

Re: converting metrics

Post by dunbarx » Sun Mar 25, 2012 6:38 pm

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 » Mon Mar 26, 2012 4:34 pm

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: 10356
Joined: Wed May 06, 2009 2:28 pm

Re: converting metrics

Post by dunbarx » Mon Mar 26, 2012 5:54 pm

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