0

When the value is zero, numeral.js prints a space instead of 0.00. I need this case to print 0.00.

This prints space:

let x = numeral(0).format('0.00');
console.log(x);

if the value is not zero, this works fine. Any ideas how to fix this?

ps0604
  • 1,227
  • 23
  • 133
  • 330
  • File an issue over on https://github.com/adamwdraper/Numeral-js/issues (after checking to see if it's a known problem)? But at the same time, why do you need numeral.js for this? `(0).toFixed(2)` works perfectly fine. – Mike 'Pomax' Kamermans Aug 04 '23 at 03:34
  • I recommend using default API Intl or toFixed to solve because this library is no longer under maintenance – Tachibana Shin Aug 04 '23 at 03:38

0 Answers0