JavaScript Currency Formatting

Hi. I needed to Turkish currency formatting. I asked stackoverflow community.

They advice me the Numeral.js library. I think it’s a useful library. I asked myself. Why do I need a library? I didn’t need jQuery or any other library. We can use Intl.NumberFormat. It’s also simple to use.

How we use?

We replaced currency symbol because we needed only price value.

Options

  • style: Formatting type
  • currency: Which country’s currency?
  • minimumFractionDigits: Decimal setting

See jsFiddle for example: https://jsfiddle.net/aligoren/qLgw02f0/

admin

Hi. I’m Ali. I’m 23. I graduated Mehmet Akif Ersoy University from CS Related Department.

I can code with all programming languages. But today I’m writing .NET and JavaScript.

You may also like...