Questions tagged [currency]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
75
votes
7answers
5k views

What's the use case for formatting monetary values with a *system-dependent* currency symbol?

Many high-level programming languages have built-in features to format a number with a system-dependent currency symbol: -- Outputs $100.00 (en-US) or € 100,00 (de-AT) Console.WriteLine(100.ToString(&...
3
votes
5answers
339 views

How do you assess the damage in a system that has been using floats or doubles for money?

I've been assigned to a code base responsible for millions of dollars of transactions, per quarter, and has been in use for over a decade. Sifting through the solution, I see doubles used everywhere ...
4
votes
3answers
2k views

How to manage different currencies on the same e-commerce system?

Having one e-commerce system for multiple markets. Having markets related 1:1 to currencies. Having one database storing all order information (cost, price, invoicing) How to manage different ...
12
votes
4answers
2k views

Is there a single data representation that works for all currencies (even those different from Dollars, Euros, and Pounds)?

I can find many questions about libraries to use for representing amounts in some currency. And about the age old issue of why you shouldn't store currency as an IEEE 754 floating point number. But I ...
0
votes
0answers
54 views

Foreign currency processing

We are looking to expand our e-commerce store to allow customers in countries outside of the United States to shop and see prices specific to their region. The prices are not just straight markups ...
11
votes
3answers
32k views

Why is BigDecimal the best data type for currency? [duplicate]

I was reading this question and the accepted answer says that BigDecimal is the best type for representing currency values. I've also seen several other questions support the use of big decimal. Why ...
5
votes
1answer
1k views

Custom class for monetary amount (money value) instead of BigDecimal

On StackOverflow I found multiple advices to stick with BigDecimal in Java instead of reinventing the wheel. Despite that, I decided to create my custom class, and I would ask if that was a good idea ...