Header menu logo FSharp.Finance.Personal

Cent Module

utility functions for base currency unit values

Functions and values

Function or value Description

Cent.fromDecimal m

Full Usage: Cent.fromDecimal m

Parameters:
    m : decimal

Returns: int64<MeasureProduct<Cent, MeasureOne>>

lower to the base currency unit, e.g. $12.34 -> 1234¢

m : decimal
Returns: int64<MeasureProduct<Cent, MeasureOne>>

Cent.fromDecimalCent rounding c

Full Usage: Cent.fromDecimalCent rounding c

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

convert a decimal cent value to an integer cent value, rounding as appropriate, e.g. 1234.5678¢ -> 1234¢ or 1235¢

rounding : Rounding
c : decimal<MeasureProduct<Cent, MeasureOne>>
Returns: int64<MeasureProduct<Cent, MeasureOne>>

Cent.max c1 c2

Full Usage: Cent.max c1 c2

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

max of two cent values

c1 : int64<MeasureProduct<Cent, MeasureOne>>
c2 : int64<MeasureProduct<Cent, MeasureOne>>
Returns: int64<MeasureProduct<Cent, MeasureOne>>

Cent.min c1 c2

Full Usage: Cent.min c1 c2

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

min of two cent values

c1 : int64<MeasureProduct<Cent, MeasureOne>>
c2 : int64<MeasureProduct<Cent, MeasureOne>>
Returns: int64<MeasureProduct<Cent, MeasureOne>>

Cent.round rounding m

Full Usage: Cent.round rounding m

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

derive a rounded cent value from a decimal according to the specified rounding method

rounding : Rounding
m : decimal
Returns: int64<MeasureProduct<Cent, MeasureOne>>

Cent.roundTo rounding decimalPlaces m

Full Usage: Cent.roundTo rounding decimalPlaces m

Parameters:
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

round a decimal cent value to the specified number of places

rounding : Rounding
decimalPlaces : int
m : decimal<MeasureProduct<Cent, MeasureOne>>
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

Cent.toDecimal c

Full Usage: Cent.toDecimal c

Parameters:
Returns: decimal

raise to the standard currency unit, e.g. 1234¢ -> $12.34

c : int64<MeasureProduct<Cent, MeasureOne>>
Returns: decimal

Cent.toDecimalCent c

Full Usage: Cent.toDecimalCent c

Parameters:
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

convert an integer cent value to a decimal cent value, e.g. for precise interest calculation, 1234¢ -> 1234.0000¢

c : int64<MeasureProduct<Cent, MeasureOne>>
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

Type something to start searching.