Skip to main content

fromKgPerHa

@nmi-agro/fdm-source


@nmi-agro/fdm-source / fdm-core/src / fromKgPerHa

Function: fromKgPerHa()

fromKgPerHa(valueKgPerHa, unit, density?): number | null

Defined in: fdm-core/src/fertilizer-application-unit-conversion.ts:72

Alpha

Convert a stored kg/ha value back to the preferred display unit.

Uses Decimal.js to avoid floating-point rounding errors. Returns null if conversion requires density but density is missing.

Parameters

valueKgPerHa

any

The value in kg/ha to convert.

unit

AppAmountUnit

The target display unit.

density?

any

The density of the fertilizer in kg/l. Required for volume-based units.

Returns

number | null

The converted value in the target unit, or null if density is missing.