Ask HN: Naming convention for a percentage stored as a value from 0 to 1
4 comments
how about `taxrate`?
Or don't store it as a decimal between 0 and 1 - but as a value between 0 and 100 (with possible decimal points, of course), and just call it `taxpct`?
Or don't store it as a decimal between 0 and 1 - but as a value between 0 and 100 (with possible decimal points, of course), and just call it `taxpct`?
Just "fraction".
"rate", or "tax_rate", or "state_rate", or "state_tax_rate".
>No one is writing taxRateDecimalFraction as a var name.
Wait til you see Java or Hungarian Notation
Wait til you see Java or Hungarian Notation
“Decimal fraction” seems most correct but is very verbose. No one is writing taxRateDecimalFraction as a var name.