This is a migrated thread and some comments may be shown as answers.

[Solved] How format number in Spanish Localization?

3 Answers 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 04 Oct 2010, 03:37 PM
Hi.

A column in my grid is a number and I would like to format with millar separation and non-decimals.

Example: 123456  ---> 123.456
                12345678 --> 12.345.678
                10 -> 10
                100 -> 100
                1000 -> 1.000

Like Excel formating I use:

columns.Bound(o => o.Valor).Title(

"Valor").Format("{0: #.##0}");

 


But the grid show for 1200  (an example) --> 1200,000 and I need 1.200

What is wrong?

Thanks.

PD: In the aspx page, I use Culture="es-ES". I trie the grid localization .Localizable("es-ES") but didn't work.

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 04 Oct 2010, 04:19 PM
Hello Daniel,

If grid uses Ajax binding, you need to turn on globalization on the client using Globalization(bool)
method of the ScriptRegistrar:
<% Html.Telerik().ScriptRegistrar().Globalization(true) %>

The Globalization(...) method will serialize the required Culture properties to the client.

Regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Daniel
Top achievements
Rank 1
answered on 04 Oct 2010, 04:50 PM
Hi Georgi.

I tried your suggestions, but the grid still show the same format number.

For 1200, it show 120,000    ; and I need 1.200

My current format is: Format("{0: #.##0}");

I attach a image.

Thanks.
0
Georgi Krustev
Telerik team
answered on 05 Oct 2010, 11:00 AM
Hello Daniel,

You can try with something like that :
{0:#,##0}

For more information I suggest you check this help topic.

Regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or