1. 34
    1. 16

      To add to this list, sometimes the same currency is represented in different units in different markets. For example, US bonds are often quoted in fractions, rather than decimals.

      US mortgages typically use 32nd’s (or 64th’s) when priced. Tickers will usually represent the price as something like “99-24”, which means 99 and 24/32, or 99.75. Note that this isn’t a price in dollars, but rather a percent of the face value of the bond, which is typically (but not always!) $1000. In other words, 99-24 = $997.50.

      There’s also a “+” suffix that means “add 1/64th”, so “99-24+” is $997.65625.

      US treasuries also use 32nds, but US municipals use decimal. However, municipals are quoted in percentages as well, so a muni quoted at 99.56 is 99.56% of face value.

      There’s also language that comes with it – 1/32 is a “tick”, and 1/100th of 1% is a “bip” (slang for “basis point”).

      Different countries have different conventions for the bond market, but the US seems pretty keen on using ticks for some reason. It’s often rumored that confusing units are kept around to frighten lay people, and keep the market an exclusive and elitist place. I don’t necessarily agree, but it’s an amusing idea nonetheless :).

      1. 1

        For example, US bonds are often quoted in fractions, rather than decimals.

        I think this is pretty common in finance, as it helps avoiding to use cross currency valuations.

    2. 6

      Like a lot of these “falsehoods” articles, for many cases these “falsehoods” are perfectly true.

      Take the “all currencies currently in circulation are subdivided in decimal units” point for example. There are only two currencies in use that are non-decimal: those of Madagascar and Mauritania. I don’t want to be dismissive of these countries, but they’re small developing countries, and the chances that code you create will have to deal with these currencies are quite small, so for most practical purposes it’s just fine to assume all currencies are decimal.

      The world is a big and complex place, and you can’t deal with every single edge case. Most of the time there is no need to, and it’s much easier to just “believe the falsehoods” and deal with the common cases in a straightforward way.

      1. 17

        The world is a big and complex place, and you can’t deal with every single edge case. Most of the time there is no need to, and it’s much easier to just “believe the falsehoods” and deal with the common cases in a straightforward way.

        Project management has talked about known unknowns and unknown unknowns. These lists turn the latter into the former. Knowing these edge cases exist can help design the solution space around them, explicitly design them out of the system, or at least document their presence.

        So yes, most of the time handling the common cases straightforwardly is right, but you can at least do it with eyes open.

      2. 8

        Seconded.

        1. A price can be at most 10^N for some value of N.

        Let me interpret this: Whatever prices your system can process, it’s never enough. Using computers with infinite resources and processing power is therefore recommended.

        1. 1

          Right, and your boss might want you to write out that sandwich price as R$14,999,999,999.99 instead of RB$15 because it sounds cheaper that way.

      3. 2

        There are only two currencies in use that are non-decimal

        Another small country you may have heard of is Japan

        1. 2

          I’m not sure what your point is, because that Wikipedia article specifically states that it’s decimal in the lead section.

          1. 1

            I stressed the wrong point, what I meant to point out is that yen are not subdivided at all.

            I agree with you that it’s pointless to support iraimbilanja and khoums though, as both their respective currencies have more standard and more used decimal subdivisions.

            1. 2

              Well, yes. But that’s the next point on the list:

              All currencies are subdivided. (counter-examples: KRW, COP, JPY… Or subdivisions can be deprecated.)

              Japanese Yen, Indonesian Rupiah (which I use every day), and quite a few others are still decimal, even though not subdivided.

        2. 1

          The page you link to mentions 2 subdivisions of the yen, in 1/100 and 1/1000.

          In practical terms it’s a single unit though.

          The Indonesian rupiah is another currency with low real unit value, but its 1/100 subdivision is explicitly noted as “obsolete”.

          1. 4

            Not since 1953. (Sorry, can’t find an English article on it.) The words ‘sen’ and ‘rin’ are still used when referencing fractions when trading and whatnot, but no, they do not actually exist anymore.

            1. 1

              I think we can be charitable and assume that what the author means with “non-decimal” is

              • a “unit” currency (yen, rupiah, ex-Italian lira), which cannot be subdivided
              • a currency that is subdivided, and then always in multiples of 10.
    3. 1

      Oh I’m so bookmarking this for data quality and internationalization examples.

    4. 1
      1. You can store a price in a floating point variable.

      This is how Cobol is holding us hostage. Spoilers: With fixed point fractions.

      1. 1

        That was a great read, thanks for linking!