Skip to content

Instantly share code, notes, and snippets.

@bearkfear
Created October 2, 2020 13:07
Show Gist options
  • Save bearkfear/b3a24e83aec9b0650de983d94ba811c7 to your computer and use it in GitHub Desktop.
Save bearkfear/b3a24e83aec9b0650de983d94ba811c7 to your computer and use it in GitHub Desktop.
humanFormat: function(number) {
if (isNaN(number)) {
number = "";
} else {
// number = Number(number).toLocaleString(this.options.locale, {maximumFractionDigits: 2, minimumFractionDigits: 2, style: 'currency', currency: 'BRL'});
number = Number(number).toLocaleString(this.options.locale, {
maximumFractionDigits: this.options.precision,
minimumFractionDigits: this.options.precision,
});
}
return number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment