Variable naming is important!
// bad
let fee = 0.035
let feePercentage = 3.5
// good
let feeRate = 0.035
Variable naming is important!
// bad
let fee = 0.035
let feePercentage = 3.5
// good
let feeRate = 0.035
4. Any percentages must be represented as rates (n/1) e.g 3.5%=0.035 as opposed to percentage point units (n/100) or basis point units (n/10000)
4. Any percentages must be represented as rates (n/1) e.g 3.5%=0.035 as opposed to percentage point units (n/100) or basis point units (n/10000)
1. Don’t round whenever possible (we use IEEE-754 decimal128 in memory and for calculations, but strings (preferred) or Int64MinorUnits on the wire)
2. When rounding is unavoidable, use ToNearestEven (aka Bankers rounding)
1. Don’t round whenever possible (we use IEEE-754 decimal128 in memory and for calculations, but strings (preferred) or Int64MinorUnits on the wire)
2. When rounding is unavoidable, use ToNearestEven (aka Bankers rounding)
At Monzo (a bank), we call the “cents” “minor units”, because that’s the more technically correct term globally
At Monzo (a bank), we call the “cents” “minor units”, because that’s the more technically correct term globally