Hello World

Money

All chapters

Part 3 · Numbers, money, time and place

Money

Chapter 12 17 min read 11 sections

A customer puts something worth ¥1,500 in their basket. Your payment code multiplies by 100 to get the amount in "cents", like it does for every other currency, and asks the payment provider to charge 150,000. The customer has just been asked for a hundred times the price.

The yen doesn't have cents. It has no minor unit at all. Code written with dollars, pounds and euros in mind assumes every currency splits into a hundred smaller pieces, and that assumption is one of many that money breaks.

Money is where localisation mistakes cost real money, sometimes yours and sometimes your customer's. This chapter covers storing it, showing it and charging it in a way that works outside your own country.

Keep reading

The rest of this chapter is for readers of the book

Get the book to read the rest of this chapter and every other one, the field guide and the glossary, and to download the whole book as a PDF.

Still to come in this chapter

  • It doesn't make cents to store it as a float
  • Currencies don't all have two decimal places
  • Formatting prices
  • "$5" isn't a price
  • Is tax included?
  • Payment methods
  • Designing for money
  • Converting prices vs pricing per market
  • Pricing for purchasing power
  • Checklist
  • Further reading