Number
Overview
Formats a given number based on various additional hints, such that its appearance becomes aligned with the desired scheme.
<number
value: number
↪ Numeric value to format
absolute, abs: boolean(false)
↪ Whether to disregard the negative sign
integer, int: boolean(false)
↪ Whether to disregard the fractional part
format: string(null)
↪ Pattern to format the number with
↪ See: https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html
rounding: string(null)
↪ Rounding-mode to use when truncating decimal-digits
↪ See: https://docs.oracle.com/javase/8/docs/api/java/math/RoundingMode.html
locale: string(null)
↪ Dictates separators, grouping-symbols and currencies
↪ E.g. de_AT, en_GB, etc.
/>
Examples
Fixed Decimals
Formatting a fractional value of arbitrary complexity to a visually appealing two-decimals number.
Code-Blocks are only available within the browserAbsolute Values
Removing the negative-sign Code-Blocks are only available within the browser, if any.
Code-Blocks are only available within the browserWhole Numbers
Dropping all decimal digits, if any.
Code-Blocks are only available within the browserPadding
Adding additional leading zeroes, as to ensure a fixed width.
Code-Blocks are only available within the browser