Closed
Description
Inspired by PR #54 I would like to suggest the following guidelines for how to write numbers and units:
- These conventions should be documented near the top of the document, as needed.
- Use the binary prefix ki (kibi) prefix when referring to 1024, and Mi (mebi) prefix when referring to 1024*1024. (Feel free to argue against this point, however. Note: binary prefixes are currently almost not used.)
- Capitalize prefixes according to either SI or IEC standards: kilo=k, mega=M, kibi=ki, mebi=Mi. (Note: currently, kilo is fairly consistently capitalized (K) across the document.)
- Abbreviate bytes as B when used with a prefix. Spell out bits as bits, even when used with a prefix to avoid ambiguity. (Note: currently byte is fairly consistently written as a full word.)
- Find a suitable prefix or suffix to use for hexadecimal numbers. I'm undecided which format should be used, but I'm personally leaning toward standardizing on $ prefix which is used by RGBDS. But either way, let's decide on one and stick with it. (Note: currently it's a mix between Martin's convention of the suffix h, assembler centrix $, c-centrix 0x, and even sometimes x formatted as multiplication sign in running text, which to me just looks very wrong.)
- To prevent clutter, don't use a prefix for hex numbers when it's clear from the context that a number is hexadecimal. For example addresses and lists of opcodes. In those cases, zero pad, even for smaller number. (Eg: 0000-3FFF instead of 0-3FFF. Note: Currently the document pretty much follows this guideline.)
- Put a space between numbers and their unit. (Note: Currently, memory sizes are often written as 4KB or similar.)
- Decimal numbers should be written with a decimal point instead of a comma. (I'm only bringing this up because the physical screen sizes are currently written with a decimal comma.)
- Binary numbers: I suspect that it's sufficiently clear from context when a binary number is used. But when/if a prefix is needed, I suggest %, which is what RGBDS is using.
Feel free to discuss or add more suggestions in case I've forgotten some corner case.