Currency fromat in asp.net

Posted by Sushilkumar.sush under C# on 8/5/2011 | Points: 10 | Views : 1524 | Status : [Member] | Replies : 1
hi all,
i want show the currency as per language how i can i do this..
please help me...
The currency should be shown in German format(1.40.305,00).normal format only(1,40,305.00).

Thanks in Advance

Sushilkumar Shinde


Responses

Posted by: Hmanjarawala on: 8/5/2011 [Member] Bronze | Points: 25

Up
0
Down
Currency will split the long number per 3 numbers. So the easiest solution for you now:

<%#Eval("MoneyField","#,##,##.00")%>

And what's more. I notice that you want to split number per two. Please check what's the culture you are. You should set the current culture and use the correct money, for example if you set French:

CultureInfo c = CultureInfo.GetCultureInfo("Fr");
decimal d = 1234567890.9876m;
Console.WriteLine(d.ToString(c));

In asp.net, you should set here:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestWebDemo.WebForm1" Culture="Fr"%>

Set a proper culture info for a specific country and you can use what the man says above me.

:)


Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Sushilkumar.sush, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response