Skip to content

Blazor Custom formatting for numbers and strings #9435

Closed
@ericgrantholland

Description

@ericgrantholland

I am looking into formatting strings and numbers using blazor-data-bindings. For example, formatting a number with currency, formatting a number with thousands-separators. Currently, there is a method of formatting only DateTime fields as shown below:

<input type="text" bind="@Birthday" /><br /> What is your birthday (German date format)? <input type="text" bind="@Birthday" format-value="dd.MM.yyyy" /><br />

You can always use a Javascript library such as AutoNumeric, but an out-of-the-box solution would speed up development and user-experience. AutoNumeric can also apply formats live while the user is typing in the input fields.

Here are a few simple number formats for demonstration.
-Currency ($5,700.99, €65.76, £62 )
-Percentages (56.789%, 99%)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: DuplicateResolved as a duplicate of another issuearea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing one

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions