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

Requesting conversion of full text input to treat last two values as the cent amount (e.g. input: 200 => $2.00) #206

Closed cogden14 closed 4 years ago

cogden14 commented 4 years ago

This is a formatting issue. This would allow a bank-like feature where the full input converts to the dollar and cent amount based on the last two values being the cent amount.

joshstrange commented 4 years ago

Came here looking for the same thing only to find it looks like it's not supported. Since I'm early in my integration I'm just going to switch to dinero.js as it expect all inputs to be in the smallest currency form (so pennies/cents for USD) which is the format the data I'm working with comes back in.

cogden14 commented 4 years ago

@joshstrange I used https://stackoverflow.com/a/12914149

joshstrange commented 4 years ago

@cogden14 Thanks! I ended up writing my own VueJS filter using dinero.js which is working very well.

cogden14 commented 4 years ago

@joshstrange That's awesome!