getFormattedWeight

Creates a LocalizedString that contains a text with a weight

Parameters

grams
the weight in g

fun getFormattedWeight(grams: Double, unitValue: Double, precision: Int, tailingFractionZeros: Boolean): LocalizedString

Creates a LocalizedString that contains a text with a weight

Parameters

grams
the weight in g
unitValue
factor that determines the technical postfix (1=g, 1000=kg, 0.001=mg, ...).
For automatic selection, pass the same value as for `grams`.
precision
see  [LocalizedStringNumber.precision]
tailingFractionZeros
see [LocalizedStringNumber.tailingFractionZeros]