Leading zeros
By default, Numora React strips leading zeros from the integer part of a number. Set allowLeadingZeros to preserve them.
allowLeadingZeros: trueLeading zeros are kept
Removed (default)
Type "007" and it becomes "7"
Preserved
Type "007" and it stays "007". Grouping still applies, so "0001" shows as "0,001"
Rules
- Only the integer part is affected. Decimal zeros are never touched (
"0.05"stays"0.05") - Numora React always keeps a bare
"0" - Negative numbers keep their sign (
"-007"→"-7", withallowNegative)
Keep the default for currency and numeric inputs. Preserve zeros for product codes, IDs and other formats where zero-padding matters.
Auto-prepend leading zero
Set padLeadingZero 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.
Type ".5" and it becomes "0.5"
- Runs after
allowLeadingZerostrimming, so you can combine the two. Only the optionalmaxLengthtruncation runs later - Uses your
decimalSeparator(e.g.","for European format)