Skip to main content

Function: lineAmountCents()

lineAmountCents(hours, hourlyRateCents): Cents

Defined in: src/lib/invoice/index.ts:97

Amount for a line = billed hours × hourly rate, rounded half-away-from-zero to whole cents.

Parameters​

hours​

number

Billed hours for the line (typically the output of billedHours).

hourlyRateCents​

number

The USD hourly rate in integer cents.

Returns​

Cents

The line amount as branded USD Cents (integer; rounding is symmetric for negatives).

Throws​

MoneyError (via cents) if hours × hourlyRateCents is non-finite (NaN/Infinity) or the rounded product exceeds the safe-integer range.