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

Text Format for Decimal

I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?

AmountL.Text = dr.Item("Amount")

Thanks!

Phil
Oct 8 '07 #1
8 1902
On Oct 8, 8:35 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?

AmountL.Text = dr.Item("Amount")
Hi Phil

try to format String.Format("{0:0,0}", dr.Item("Amount"));
Oct 8 '07 #2
"pvong" <phillip*at*yahoo*dot*comwrote in message
news:et**************@TK2MSFTNGP06.phx.gbl...
I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?

AmountL.Text = dr.Item("Amount")
AmountL.Text = dr.Item("Amount").ToString("#,##0.00")
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 8 '07 #3
Mark,
I'm getting this error message.
Input string was not in a correct format.
I'm trying to do this in VB.Net
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uR**************@TK2MSFTNGP04.phx.gbl...
"pvong" <phillip*at*yahoo*dot*comwrote in message
news:et**************@TK2MSFTNGP06.phx.gbl...
>I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?

AmountL.Text = dr.Item("Amount")

AmountL.Text = dr.Item("Amount").ToString("#,##0.00")
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 8 '07 #4
This is almost perfect. It cuts off my pennies. How do I get it to include
the 2 digits after the decimal?
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
On Oct 8, 8:35 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
>I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?

AmountL.Text = dr.Item("Amount")

Hi Phil

try to format String.Format("{0:0,0}", dr.Item("Amount"));


Oct 8 '07 #5
On Oct 8, 9:27 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
This is almost perfect. It cuts off my pennies. How do I get it to include
the 2 digits after the decimal?

"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
On Oct 8, 8:35 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?
AmountL.Text = dr.Item("Amount")
Hi Phil
try to format String.Format("{0:0,0}", dr.Item("Amount"));- Hide quoted text -

- Show quoted text -
{0:0,0.00}

Oct 8 '07 #6
"pvong" <phillip*at*yahoo*dot*comwrote in message
news:eG*************@TK2MSFTNGP02.phx.gbl...

[top-posting corrected]
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uR**************@TK2MSFTNGP04.phx.gbl...
>"pvong" <phillip*at*yahoo*dot*comwrote in message
news:et**************@TK2MSFTNGP06.phx.gbl...
>>I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?

AmountL.Text = dr.Item("Amount")

AmountL.Text = dr.Item("Amount").ToString("#,##0.00")
I'm getting this error message.
Input string was not in a correct format.
I'm trying to do this in VB.Net
AmountL.Text = Convert.ToDecimal(dr.Item("Amount")).ToString("#,# #0.00")
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 8 '07 #7
PERFECT!!!!

Thanks!
Phil

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@22g2000hsm.googlegrou ps.com...
On Oct 8, 9:27 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
>This is almost perfect. It cuts off my pennies. How do I get it to
include
the 2 digits after the decimal?

"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11**********************@k79g2000hse.googleg roups.com...
On Oct 8, 8:35 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?
>AmountL.Text = dr.Item("Amount")
Hi Phil
try to format String.Format("{0:0,0}", dr.Item("Amount"));- Hide quoted
text -

- Show quoted text -

{0:0,0.00}

Oct 8 '07 #8
Perfect! Thanks!
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:ur****************@TK2MSFTNGP04.phx.gbl...
"pvong" <phillip*at*yahoo*dot*comwrote in message
news:eG*************@TK2MSFTNGP02.phx.gbl...

[top-posting corrected]
>"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uR**************@TK2MSFTNGP04.phx.gbl...
>>"pvong" <phillip*at*yahoo*dot*comwrote in message
news:et**************@TK2MSFTNGP06.phx.gbl...

I'm grabbing "Amount" from a DB with Decimal format. The outpul of
AmountL.Text comes up as 9999999.99 and I want to format this so it is
displayed as 9,999,999.99. Can someone help me with this simple task?

AmountL.Text = dr.Item("Amount")

AmountL.Text = dr.Item("Amount").ToString("#,##0.00")
>I'm getting this error message.
Input string was not in a correct format.
I'm trying to do this in VB.Net

AmountL.Text = Convert.ToDecimal(dr.Item("Amount")).ToString("#,# #0.00")
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 8 '07 #9

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

Similar topics

11
by: alex | last post by:
Hi, I am looking for a way to populate an HTML table from an external local text file which looks like this: DATE/TIME LAT. LON. DEPTH. ML....
17
by: Phill Long | last post by:
Right, ok, well I have designed a form that will display a price (22.34) in a text box, and another price in the other text box... I also have a blank text box... Now I want to add both the prices...
6
by: J | last post by:
Would anyone know if there a type tag to format a double? I have f for floating point, but cannot find one for double.
3
by: stevek | last post by:
How do I format an integer. Add commas. 1234565 1,234,565 TIA
2
by: Jayjay | last post by:
I've got a report that has a series of unbound text boxes that are being populated by some variables in code. The format is supposed to be a currancy format, but on a certain series of boxes, I...
2
by: Todd_M | last post by:
I was wondering what anyone might suggest as "best practice" patterns for streaming out fixed formatted text files with C#? Let's say we get our data in a dataset table and we need to iterate over...
11
by: shsandeep | last post by:
I used the following query to retrieve the date in dd-mon-yyyy format. db2 => SELECT RTRIM(CHAR(DAY(COVG_TYP_STRT_DT))) || '-' || RTRIM(MONTHNAME(COVG_TYP_STRT_DT)) || '-' ||...
2
by: jmarr02s | last post by:
I have a field with a Number data type, Double field size and Auto decimal places. The values of this field should have 3 digits to the right of the decimal place. For example, 123456.123 I...
9
by: NEWSGROUPS | last post by:
I have data in a table in an Access 2000 database that needs to be exported to a formatted text file. For instance, the first field is an account number that is formatted in the table as text and...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.