473,394 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

.ToString("c") location

Hi

When you have something like this:

decimal d = 17.4m;
Response.Write(d.ToString("c"));

The output becomes: 17,50 kr. If the culture is set to swedish.

So my question is. Where in the framework is the class/function that does
the rounding for each and every currency?

Thanks

Sep 16 '06 #1
3 2732
See http://msdn2.microsoft.com/en-us/lib...alization.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"Senna" <Se***@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
Hi

When you have something like this:

decimal d = 17.4m;
Response.Write(d.ToString("c"));

The output becomes: 17,50 kr. If the culture is set to swedish.

So my question is. Where in the framework is the class/function that does
the rounding for each and every currency?

Thanks

Sep 16 '06 #2
I would also consider downloading Reflector (Lutz Roeder's tool) and looking
at sysglobl.dll from the framework if you want to get even more information
about the inner workings.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Kevin Spencer" <uc*@ftc.govwrote in message
news:Ob**************@TK2MSFTNGP04.phx.gbl...
See http://msdn2.microsoft.com/en-us/lib...alization.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"Senna" <Se***@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
>Hi

When you have something like this:

decimal d = 17.4m;
Response.Write(d.ToString("c"));

The output becomes: 17,50 kr. If the culture is set to swedish.

So my question is. Where in the framework is the class/function that does
the rounding for each and every currency?

Thanks


Sep 16 '06 #3
Thanks Gregory. Have now been looking thru all of sysglobl.dll but can find
any actually code that shows how they are doing the currency rounding. Any
tips.

"Cowboy (Gregory A. Beamer)" wrote:
I would also consider downloading Reflector (Lutz Roeder's tool) and looking
at sysglobl.dll from the framework if you want to get even more information
about the inner workings.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Kevin Spencer" <uc*@ftc.govwrote in message
news:Ob**************@TK2MSFTNGP04.phx.gbl...
See http://msdn2.microsoft.com/en-us/lib...alization.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"Senna" <Se***@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
Hi

When you have something like this:

decimal d = 17.4m;
Response.Write(d.ToString("c"));

The output becomes: 17,50 kr. If the culture is set to swedish.

So my question is. Where in the framework is the class/function that does
the rounding for each and every currency?

Thanks


Sep 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Olaf Baeyens | last post by:
A question: (C#, C++) If I use iValue.ToString("000000000000",CultureInfo::CurrentUICulture)); The I get a string with a fixed lengt if format: "000000542663" But since I want the leading "0"...
6
by: trint | last post by:
Here is the vb.net version of what I need to do in c#: myString = drSQL.Item("columnName").ToString() Thanks, Trint
1
by: Steve Norman | last post by:
Hi All, I am trying to display an int as it' sHex representation, and looking on MSDN it appears this can be done with .ToString("X"). This does work, but the example on MSDN...
0
by: Norman Yuan | last post by:
I posted this issue a while ago. After moveing the ASP.NET 1.1 app to a brand new server, the same problem still there. System: Winows2003 server std. .NET 1.1 App: Invoicing system Problem:...
4
by: Larry Smith | last post by:
Once you call "ToString()" for an object, how can you then convert the string back to the original object (assuming you know its type of course)? Also, why does "ToString()" produce one string and...
6
by: Zeng | last post by:
Math.Round has good behavior as following: Math.Round(3.45, 1); //Returns 3.4. The last '5' is thrown away because 4 is even Math.Round(3.75, 1); //Returns 3.8. The last '5' is used because '7'...
1
by: Marc Gravell | last post by:
Just been debugging a daylight savings glitch... something that interested me: (in a BST locale at 5:14 local time, 4:14 GMT) DateTime.Now.ToString("R") >"Mon, 26 Mar 2007 05:14:34 GMT" ...
5
by: Bob | last post by:
Hello Folks, I am bring backa data reader dr from the database/ So I have a number of fields such as dr To put this in a table I use "<td>" + dr.ToString() + "</td>" But I want to...
2
by: maminx | last post by:
hello all...i have the page that using an ajax (evalJSON). it's running well in local (pc for develop), but when the page run in server (using linux), the page goes error, and shown an error console...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.