Method EinvoiceDecimal():toPlain() Professional

Converts the value to a string without trailing zeros.

Syntax
:toPlain( [<nMinDp>], [<nMaxDp>] ) --> cValue
Parameters
<nMinDp>
The minimum number of decimal places to keep. This defaults to 0.
<nMaxDp>
The maximum number of decimal places. This defaults to 4.
Return

A string with the formatted value.

Description

Converts the value of the object to the shortest character string which has at least <nMinDp> and at most <nMaxDp> decimal places. The value is first rounded to <nMaxDp> decimal places, then trailing zeros are removed until only <nMinDp> decimal places remain. For example, :toPlain( 0, 4 ) converts the value 2 to "2" and the value 2.5 to "2.5".

This method is used for quantities, prices and percentages. If <nMaxDp> is less than or equal to <nMinDp>, the result is the same as that of :toFixed( nMaxDp ).

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.