JavaScript: Decimal Values
问题 What can I use as a decimal type in JavaScript? It's not supported ( 0.1 + 0.2 !== 0.3 ), and I need it for representing exact values in a banking/financial application. See The State and Future of JavaScript for a good read and the dirty details behind JavaScript and it's (lack of) support for decimal arithmetic. By "decimal", I mean either: infinite-range and arbitrary-precision (like BigDecimal in Java), or limited range and precision, but suitable for financial calculations (like decimal