Formatting data in "RadzenNumeric" control

Hey,

I apologize for the NewBee question.

So I'm working on a BLAZOR Web application in Visual Studio 2019.

I have a "RadzenNumeric" control on a form bound to an object-property of type decimal (C#).

It works and displays my data but it formats the data as 999.9999.

I want to format the bound data as "999.99" - two decimal places instead of four.

I played around with the syntax on "@bind-Value" without luck.

I looked through your online documentation (https://www.radzen.com/documentation/).

I didn't find what I am looking for. Maybe I just missed it...

Any suggestions ? An example would be great.

The control markup is below :

<RadzenNumeric TItem="decimal?" @bind-Value="@ApplicationState.CurrentCampaign.CurrentPromotion.PriceBook.StandardCostAmount" Style="width:5em;" Change="(decimal x) => ValidateChangedField(x)" />
<ValidationMessage For=@(() => ApplicationState.CurrentCampaign.CurrentPromotion.PriceBook.StandardCostAmount) />

Thanks,

Hi @rusty.watrous,

Currently the RadzenNumeric doesn't support the requested feature. We will probably add support for it in one of the next releases.

1 Like

I would second this one. I just started this and it is a bit of a disappointment that I can format my values in the grid but I can't do much with them in the edit or create forms for consistency.

Here is hoping it can be added soon so I can continue evaluating this tool as a solution.

It's now June 10 2020. Has this been implemented yet?

No, this feature hasn't been implemented.

I've solved this by changing the control to a text box and formatting the bound value as follows:

${tablea.FieldOne.HasValue?tablea.FieldOne.Value.Tostring("N4"):""}

took me ages to find that i needed to have both the Value and then ToString for this to work

this gives 1,234.0000 in the text box

hope this helps