Leading zeros
By default, Numora removes leading zeros from the integer part of a number. Set allowLeadingZeros: true to keep them.
allowLeadingZeros: trueLeading zeros are kept
Rules
- Only the integer part is affected. Decimal zeros are never touched (
"0.05"stays"0.05"). - Numora always keeps a bare
"0" - Negative numbers keep their sign (
"-007"→"-7", withallowNegative: true)
Keep the default for currency and numeric inputs. Enable leading zeros for product codes, IDs and other formats where zero-padding matters.
Auto-prepend leading zero
Set padLeadingZero: true to prepend 0 before a bare decimal separator. Use it when you want .5 stored as 0.5, so the value parses the same way everywhere downstream.
- Runs after
allowLeadingZerostrimming, so you can combine the two. Only the optionalmaxLengthtruncation runs later. - Uses your
decimalSeparator(e.g.","for European format)