0

I use NumeralJS for formatting amounts as below;

numeral(unformattedValue).format(amtFormat)

Now if the amtFormat is set as "0,0.00", then if the amount is entered as "123.1", I get it as "123.10"

Now I have certain cases where I do not want to apply any formatting (i.e. after the decimal)...So in the above example, if user enters "123.1", I should get same "123.1" Is it possible to somehow set the "amtFormat" to something which can give me that ?

So it is probably like not running the above code itself. But for some reasons (there is other common logic running as well including thousands/pre-decimal other formatting), I want to set the "amtFormat" explicitly which does nothing post decimal place.

copenndthagen
  • 49,230
  • 102
  • 290
  • 442

1 Answers1

0

I tried this link for the javascript

https://cdnjs.cloudflare.com/ajax/libs/numeral.js/2.0.6/numeral.min.js"

And test like this, var amt = '0, 0.00'; console.log(numeral(123.1).format(amt));

And in console, it shows 123.10.

Can you try with the numberal.js with given link?

Ultimate
  • 76
  • 9