Last updated
Last updated
Formatters can be chained with dynamic parameters to create complex operations, check out the example in .
converts from one currency to another
exchange rates are included by default
you can provide a new exchange rate for one report in options.currencyRates
of Carbone.render
or globally with Carbone.set
convCurr()
without parameters converts automatically from options.currencySource
to options.currencyTarget
rounds a number
same as toFixed()
but it rounds number correctly round(1.05, 1) = 1.1
formats number according to the locale
applying a number of decimals depends on the report type:
for ODS
/XLSX
, the number of decimals has to be formatted based on the text editor
for the other type of files, the number of decimals depends on the precision
parameter passed to the formatter
Adds 2 numbers.
Subtracts 2 numbers.
Multiplies 2 numbers.
Divides 2 numbers.
Converts a number to an INT.
Converts a number with English specifications (decimal separator is a dot .
).
Converts a number into string, keeping only decimals.
Converts a number with French specifications (decimal separator is a comma ,
).
precision
number of decimal
number
precision
[optional] number of decimals