Skip to main content

I have a requirement to send an email to the destination users, with some of the information entered in the InfoPath. This information contains the Amount field, that should be in the currency format like $200,000.


I wrote the Server event code where it copy all the required infomation into the DataFields. In used following code to convert to Currency or Money format,


node = xmlDoc.SelectSingleNode(

"//my:myFields/my:CERInfo/my:CERAmount", nameSpaceMgr);


String cerAmount = String.Format("{0:C}", node.InnerXml);


 The above code didnt work and still showing just number wtihout any format like 200000.


So, can i show currency format in the email.


Thanks


 

The format string "{0:C}" is used to convert a number to a formatted string.  You're passing it a string that contains a number. 

Yes, you are right. I try to convert string to string, how stupid i am. I thought, i am converting Decimal to string.


 Any way, now i am converting String to Decimal then converting Decimal to currency format.


Thank you very much for your time.


Reply