openexchangerates / accounting.js

A lightweight JavaScript library for number, money and currency formatting - fully localisable, zero dependencies.
http://openexchangerates.github.io/accounting.js
MIT License
4.95k stars 528 forks source link

How to add decimal point to floating number? #197

Closed leonardeveloper closed 5 years ago

leonardeveloper commented 6 years ago

I'm working on a payment module and I can't figure out how can I add floating values with decimal. I tried .toFixed(2) but didn't work.

Also did accounting.formatNumber(parseFloat(tendered), 2); but didn't work as well.

You can check my Stack Overflow question here