Skip to content

ignored prefixes #66

Closed
hynkle opened this Issue Mar 20, 2013 · 2 comments

3 participants

@hynkle
hynkle commented Mar 20, 2013

It appears that when a unit has multiple prefixes, all but the last one are ignored. That is to say, the following all equal 3 cg:

Unit.new('3 mcg')   # this is how I originally discovered the issue,
                    # mistakenly thinking this would be micrograms
Unit.new('3 ccg')
Unit.new('3 cccccg')
Unit.new('3 yottagigamicrocg')

I don't know what should happen (is a ccg a hundredth of a hundredth of a gram, or just meaningless garbage?), but I presume silently throwing away input is not the desired behavior.

@olbrich
Owner
olbrich commented Mar 22, 2013

I think the intended behavior would be to only recognize a single prefix, centi-centi-meters is silly and I'm fairly sure there's a standard somewhere that says you can only have one prefix.

@Nkburdick

At least for SI units, @olbrich Is correct. You are only supposed to have one prefix. SI Brochure

From Wikipedia:

The prefixes are never combined, and multiples of the kilogram are named as if the gram was the base unit. Thus a millionth of a metre is a micrometre, not a millimillimetre, and a millionth of a kilogram is a milligram, not a microkilogram.

@olbrich olbrich closed this Jul 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.