Skip to content

Leading zeros

By default, Numora React strips leading zeros from the integer part of a number. Set allowLeadingZeros to preserve them.

allowLeadingZeros: true

Leading zeros are kept

Removed (default)

Type "007" and it becomes "7"

<NumoraInput />

Preserved

Type "007" and it stays "007". Grouping still applies, so "0001" shows as "0,001"

<NumoraInput allowLeadingZeros />

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", with allowNegative)

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"

<NumoraInput padLeadingZero />
  • Runs after allowLeadingZeros trimming, so you can combine the two. Only the optional maxLength truncation runs later
  • Uses your decimalSeparator (e.g. "," for European format)