Skip to content
TEXT AND NUMBERS · FREE

PercentField

Type percentages naturally while the value stays a clean fraction.

People type 12.5, your code needs 0.125. PercentField lets users enter a percentage naturally while the value stays a clean fraction.

Why it helps

  • Natural entry for users
  • Clean fraction for your code
  • Culture-aware formatting

Where it fits

  • Discounts and tax rates
  • Progress and target values
  • Interest rates
PercentField control in a RayCraft page

Example

<PercentField @bind-Value="_rate" Label="Discount" Decimals="1" />
<span>Stored value: @(_rate?.ToString("0.###") ?? "none")</span>

@code {
    private double? _rate = 0.125;
}

A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.

Included in RayCraft Free. Working examples are in the GitHub repository (MIT); it holds example and demo code, not the library code.

All controls ยท Documentation