Metric vs Imperial, 30 years later



  • So I'm integrating a website with a certain large provider of shipping quotes... not too bad, the docs have a few less errors than some other big companies and the oddest thing is having to send two concatenated XML documents... I've seen worse.

    That is until I got to the units part, and I've seen this issue with 2 large US-based shipping providers, so maybe some helpful US developers can explain it for me. Suppose we have to specify a distance, we just need to provide a value and the units, right? And because the ratio between units is always the same, it doesn't matter what those units are, right? Wrong.

    Both shipping companies I've integrated with reckon they will accept distance units of 'cm' or 'in' and weight units of 'kg' or 'lb'. However, both have a real aversion to 'kg' and 'cm'. So far I've had responses like 'mesurement system not valid for selected country' (trying to use metric units with a US address or imperial units with a UK address), 'I think the error is caused by your use of these units, try normal LB and IN and see if that works' (random support guy).

    Are we brits just wierd having both metric and imperial units in common use? Are metric units used anywhere in the US?



  • Coca-cola comes in two and three liter bottles.  One-liter bottled water is common in the US, as are one liter and half-liter empty water bottles.

    Code that lets you select units, but doesn't convert automatically to whatever units the shipper is really using, is a definite WTF.  Either pass-through whatever units you're really allowing, or convert... don't give the user two choices, one of which leads to an error message!



  • the real wtf is that in 2009 people still use lb, in, oz and others measurement other than ton/kg, km/m/cm

    who uses lb and in except uk and part of us?



  • There really is no safe way to convert the units. You have to specify the measurement in the units they require. The problem is rounding.

    Here's the problem: Suppose you specify a measurement as 10 cm. They use inches. Well, 10 cm converts exactly to 3.94 inches. But if we assume two significant digits, that gives a range of 3.7 to 4.1 inches. So we cannot convert to inches and keep two significant digits.

    When you convert, you either have to lose significant digits (call 10cm 4inches) or introduce false significant digits(call 10cm 3.9 inches). In many applications, neither is acceptable.



  • @joelkatz said:

    There really is no safe way to convert the units. You have to specify the measurement in the units they require. The problem is rounding.

    Here's the problem: Suppose you specify a measurement as 10 cm. They use inches. Well, 10 cm converts exactly to 3.94 inches. But if we assume two significant digits, that gives a range of 3.7 to 4.1 inches. So we cannot convert to inches and keep two significant digits.

    When you convert, you either have to lose significant digits (call 10cm 4inches) or introduce false significant digits(call 10cm 3.9 inches). In many applications, neither is acceptable.

    Where'd you get the "3.7 to 4.1" range from having two significant digits?



  • @joelkatz said:

    There really is no safe way to convert the units.

    I read this and thought, what?! But then....

    @joelkatz said:

    ...if we assume two significant digits, that gives a range of 3.7 to 4.1 inches. So we cannot convert to inches and keep two significant digits.

    When you convert, you either have to lose significant digits (call 10cm 4inches) or introduce false significant digits(call 10cm 3.9 inches). In many applications, neither is acceptable.

    Good point - in this case both large shipping companies (lets call them XXX and XxxXx) specify the number format giving a fixed no. of decimal places (1 or 2). In extreme cases the error could be 5% (eg. converting to lb at 1 d.p. means we could be 0.05 lb out, which is a lot in a 1 lb package).



  • @joelkatz said:

    Here's the problem: Suppose you specify a measurement as 10 cm. They use inches. Well, 10 cm converts exactly to 3.94 inches. But if we assume two significant digits, that gives a range of 3.7 to 4.1 inches. So we cannot convert to inches and keep two significant digits.
     

    Oh yea, that happens to me all the time using UPS. I told them it was a 100lb package, and they said wait a minute do you mean 100.lbs or 100lbs our chart uses 3 significant digits not 1, and I punched him in the face and stole his truck.




  • TRWTF is that there is still any misunderstanding between force (weight) and mass.  The kilogram is a measure of mass and the pound is a measure of force.  The SI unit of force is the Newton (N) and the imperial unit of mass is the slug.  Personally, I think we should use the slug more often.  Perhaps the aversion to its usage lies in its homonymic counterpart: the slimy mollusk.

    </soapbox>



  •  @versatilia said:

    Good point - in this case both large shipping companies (lets call them XXX and XxxXx) specify the number format giving a fixed no. of decimal places (1 or 2). In extreme cases the error could be 5% (eg. converting to lb at 1 d.p. means we could be 0.05 lb out, which is a lot in a 1 lb package).

    Yea well. So let's see, what are you going to do when you correct your program to send them the data in their format? Are you actually going to break out the ruler/scale and re-measure in the correct units? Or send them the measure in their units and say it has an error range of +/-5%? I doubt it, you're just going to convert to the unit they want and then send it in whatever precision they let you.

    So tell me, what difference does it make who does the converting?

     This isn't a science lab, it's a shipping company. 



  • @communist_goatboy said:

    TRWTF is that there is still any misunderstanding between force (weight) and mass.  The kilogram is a measure of mass and the pound is a measure of force.  The SI unit of force is the Newton (N) and the imperial unit of mass is the slug.  Personally, I think we should use the slug more often.  Perhaps the aversion to its usage lies in its homonymic counterpart: the slimy mollusk.

    </soapbox>

     *Throws brick*



  • @communist_goatboy said:

    TRWTF is that there is still any misunderstanding between force (weight) and mass.  The kilogram is a measure of mass and the pound is a measure of force.

    It isn't, as how could versatilia attempt to convert between them if it was?



  • @communist_goatboy said:

    TRWTF is that there is still any misunderstanding between force (weight) and mass.  The kilogram is a measure of mass and the pound is a measure of force.  The SI unit of force is the Newton (N) and the imperial unit of mass is the slug.  Personally, I think we should use the slug more often.  Perhaps the aversion to its usage lies in its homonymic counterpart: the slimy mollusk.

    </soapbox>

    Yeah, but so long as we're close to a nice, reliable source of 1G, and we're not sufficiently close to any other significant source of gravity, pounds and kilograms are relatively easy to convert - at least, so long as we don't involve British currency.  If we had interplanetary travel, it would be a much bigger WTF.

    As it is, it's probably more of a WTF that someone gets bent out of shape over it... (err, like I used to...)



  • If you see "10 cm", you reason as follows:

    If the real measurement was less than 9.5 cm, it would have been reported as 9 cm, not 10 cm.

    If the real measurement was more than 10.5 cm, it would have been reported as 11 cm, not 10 cm.

    So if you see "10 cm", you have a possible range of plausible real measurements of 3.74 inches through 4.13 inches.

    So how do you convert "10 cm" to inches? "3.74-4.13 inches?" You think a shipping company that measures in inches is going to like that?

    I should have picked pounds and kilograms, but the issue is the same. The type of conversion the OP is imagining is simply not possible.



  • @mauricio said:

    the real wtf is that in 2009 people still use lb, in, oz and others measurement other than ton/kg, km/m/cm

    who uses lb and in except uk and part of us?

     

    Umm... Pretty much [i]all[/i] of the U.S. uses lb and in.  And distances here are in miles, not km.

    And why is it that in the UK, a person's weight is measured in "stone" (always in the singular). What's the conversion factor for that?

     



  • @dwilliss said:

    And why is it that in the UK, a person's weight is measured in "stone" (always in the singular). What's the conversion factor for that?
     



  • @dwilliss said:

    @mauricio said:

    the real wtf is that in 2009 people still use lb, in, oz and others measurement other than ton/kg, km/m/cm

    who uses lb and in except uk and part of us?

     

    Umm... Pretty much all of the U.S. uses lb and in.  And distances here are in miles, not km.

    And why is it that in the UK, a person's weight is measured in "stone"
    (always in the singular). What's the conversion factor for that

     

    I'd say anyone who does anything scientific might like to have a word with you, even in the USA. Unless you can find a molecular biologist or something that measures things in 'nano-inches'.

    Also, Google 'Convert 1 stone to pounds'. Google is always your friend. Google is always right. Believe in the Google. Trust in the Google. (e,f;b)



  • @dwilliss said:

    @mauricio said:

    the real wtf is that in 2009 people still use lb, in, oz and others measurement other than ton/kg, km/m/cm

    who uses lb and in except uk and part of us?

     

    Umm... Pretty much all of the U.S. uses lb and in.  And distances here are in miles, not km.

    And why is it that in the UK, a person's weight is measured in "stone" (always in the singular). What's the conversion factor for that?

     

    I've always seen a person's "weight" (mass) expressed in kg; the only lingering traces of Imperial units are in road signs (miles and mph), milk brought by the milkman and beer/cider served in a pub (pints).



  •  @Deiwos said:

    @dwilliss said:

    @mauricio said:

    the real wtf is that in 2009 people still use lb, in, oz and others measurement other than ton/kg, km/m/cm

    who uses lb and in except uk and part of us?

     

    Umm... Pretty much all of the U.S. uses lb and in.  And distances here are in miles, not km.

     

    I'd say anyone who does anything scientific might like to have a word with you, even in the USA. Unless you can find a molecular biologist or something that measures things in 'nano-inches'.

    Anyone who does anything scientific, except NASA. I'm obvsiously referring to the Mars climate orbiter fiasco.



  •  @joelkatz said:

    If you see "10 cm", you reason as follows:

    If the real measurement was less than 9.5 cm, it would have been reported as 9 cm, not 10 cm.

    If the real measurement was more than 10.5 cm, it would have been reported as 11 cm, not 10 cm.

    So if you see "10 cm", you have a possible range of plausible real measurements of 3.74 inches through 4.13 inches.

    So how do you convert "10 cm" to inches? "3.74-4.13 inches?" You think a shipping company that measures in inches is going to like that?

    I should have picked pounds and kilograms, but the issue is the same. The type of conversion the OP is imagining is simply not possible.

    Nonsense.  If I tell you "convert 10cm to inches" you're going to get an actual answer, you're not going to get a range, no matter how many or few significant digits I allow.  If I say my package is 10cm on a side, I'm not saying "it's between 9.5cm and 10.5cm", I'm saying it's 10cm.



  • @mauricio said:

    who uses lb and in except uk and part of us?

    Who uses cm to measure TVs and monitors?

    All continental European electronics sites that I checked used inches. Some added the size in centimeters in parentheses.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.