Takes a number and returns fixed digit string
Examples
var fsuxx = ; console; // "0.199"console; // "0.2"console; // "0.20"
Documentation
string
fsuxx(num, [digits], [trailing]) ⇒ Takes a number and returns a rounded fixed digit string. Returns an empty string if first parameter is (-)Infinity or parseFloat results in NaN. If parameter trailing is set to true trailing zeros will be kept.
Param | Type | Default | Description |
---|---|---|---|
num | number |
the number | |
[digits] | number |
3 |
digit count |
[trailing] | boolean |
false |
keep trailing zeros |
[comma] | boolean |
false |
use comma as decimal separator |
License
MIT (c) Sebastian Raff https://github.com/hobbyquaker