Unit Domain Mass: Difference between revisions

From imde.io

Line 28: Line 28:


'''From Source to Value in Base Unit:'''
'''From Source to Value in Base Unit:'''
Value in Base Unit = (SourceValue + ShiftBefore) * (SourceNumerator / SourceDenominator) - ShiftAfter
Value in Base Unit = (SourceValue + ShiftBefore) * (SourceNumerator / SourceDenominator) - ShiftAfter


'''From Source to value in target unit'''
'''From Source to value in target unit'''
TargetValue = ((SourceValue + ShiftBefore) * (SourceNumerator / SourceDenominator) - ShiftAfter) * ((-ShiftAfter * TargetDenominator/TargetNumerator)-Shiftbefore)
TargetValue = ((SourceValue + ShiftBefore) * (SourceNumerator / SourceDenominator) - ShiftAfter) * ((-ShiftAfter * TargetDenominator/TargetNumerator)-Shiftbefore)



Revision as of 11:04, 7 November 2022

Unit Domain: Mass

The amount or quantity of heaviness or mass; amount a thing weighs. The base unit for mass is grams.

Alternative units of measure

Units of Measure
Mass Unit Full Symbol English UoM Code Shift Before Numerator Denominator Shift after Base UoM
Microgram μg Ug - 1 1.000.000 - gr
Milligram mg Mg - 1 1.000 - gr
Gram gr Gr - 1 1 - gr
Kilogram kg Kg - 1.000 1 - gr
Tonne t To - 1.000.000 1 - gr
Ounce oz Oz - 2.834.952 100.000 - gr
Pounds lb Lb - 10.000.000 22.046 - gr

The formula to convert one Mass UoM to another is:

From Source to Value in Base Unit:

Value in Base Unit = (SourceValue + ShiftBefore) * (SourceNumerator / SourceDenominator) - ShiftAfter

From Source to value in target unit

TargetValue = ((SourceValue + ShiftBefore) * (SourceNumerator / SourceDenominator) - ShiftAfter) * ((-ShiftAfter * TargetDenominator/TargetNumerator)-Shiftbefore)

Example: Ounce to Milligram

1 Ounce * (2834952/100000) * (1000 / 1) = 28349,52 Milligram