Express localeToFixed(D, 1 )
as a fraction.
D
The number T
is in the tenths place, so we have cardinalThrough20( T ) tenths.
CardinalThrough20( T ) tenths can be written as fraction( T, 10 )
.
Express localeToFixed(D, 2 )
as a fraction.
D
The number T
is in the tenths place, so we have cardinalThrough20( T ) tenths.
CardinalThrough20( T ) tenths can be written as fraction( T, 10 )
.
The number H
is in the hundredths place, so we have cardinalThrough20( H ) hundredths.
CardinalThrough20( H ) hundredths can be written as fraction( H, 100 )
.
Add the two parts together.
fraction( T, 10 ) + fraction( H, 100 )
= fraction( T * 10, 100 ) + fraction( H, 100 )
= fraction( T * 10 + H, 100 )