3cab735754
Updated various components to utilize parseAppDecimal and formatAppDecimal for consistent decimal parsing and formatting. This change enhances the handling of numeric inputs across the application, ensuring better accuracy and user experience in forms and displays.
11 lines
340 B
TypeScript
11 lines
340 B
TypeScript
/** Liters per motor hour from daily fuel consumption and motor hours. */
|
|
export function computeFuelPerMotorHour(
|
|
fuelConsumptionL: number,
|
|
motorHours: number
|
|
): number | null {
|
|
if (motorHours <= 0) return null
|
|
return Number((fuelConsumptionL / motorHours).toFixed(2))
|
|
}
|
|
|
|
export { formatFuelPerMotorHour } from './numberFormat.js'
|