473,397 Members | 1,949 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,397 software developers and data experts.

Formatting Decimals

Hi,

I have some code that does soem calculations and writes
results out to screen.

However I want to format these figures.

For Example rather than displaying $120123.10 I want to
display it as $120,123.10

This value is contained in a decimal datatype and written
to a lable on my aspx.

Any ideas on how to do this?

Thanks,
Kerri.
Nov 17 '05 #1
1 897
This might work out for you:
decimal.Parse(MyValue).ToString( "D2" )

Here's more info:
http://www.dotnetjunkies.com/Tutoria...A&forumID=4213

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Kerri" <kerri@nospam> wrote in message
news:04****************************@phx.gbl...
Hi,

I have some code that does soem calculations and writes
results out to screen.

However I want to format these figures.

For Example rather than displaying $120123.10 I want to
display it as $120,123.10

This value is contained in a decimal datatype and written
to a lable on my aspx.

Any ideas on how to do this?

Thanks,
Kerri.

Nov 17 '05 #2

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

Similar topics

2
by: Sebastien de Menten | last post by:
Hi, I need to output numbers to a csv file and use the new csv module in python2.3: " import csv data = ,] w = csv.writer(file("out.csv","w")) w.writerows(data)
1
by: C | last post by:
Hi, I have an aspx with some labels. I set the text of these labels to be teh return value of some Functions that carry out some calculations. (My Functions return decimals) I want to...
3
by: J | last post by:
Is there anyway to format a calculated datacolumn? I would like the following column to display as money (formatted as $#,##0.00). Or how about simply displaying the column formatted as a number...
1
by: D. Shane Fowlkes | last post by:
Hey guys. I have a Repeater and a Template. One of the dataitems calls a helper function. The dataitem sends the record ID to the function and the function runs a complex query and returns a...
1
by: thomson | last post by:
Hi all, i do have a Text Box for Amount , Almost all my forms are dealing with Amounts, In My Setup I specify that only 2 decimals are allowed , in all the amounts, How do i set this...
8
by: coleenholley | last post by:
I'm trying to format this bit of code into a numeric format of 12,123 no decimals in the particular format. Here's the code: tbl_worksheet1.Rows(b).Cells(2).Text() = Format(ls_sum_gasohol,...
1
by: pebelund | last post by:
Hi I got an .aspx that got the following code (example) <td width="120"> <% = row %> </td> row takes a value from a SQL db, that is a string of numbers. On the webbsite I want this to show...
14
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
9
by: john coltrane | last post by:
Is there way to create a formatted string in a similar that is similar to sprintf? The same for printing, printf? C,D,E,F,G,N,X for currency, decimal, exponential, fixed, general, numerical,...
30
by: Ivan Reborin | last post by:
Hello everyone, I was wondering if anyone here has a moment of time to help me with 2 things that have been bugging me. 1. Multi dimensional arrays - how do you load them in python For...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.