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

formatting text in textbox as currency question

Gen
I have a simple program that takes 3 values (balance, interest, desired
payment) and calculates how many months to pay the balance, and each month's
accrued interest, and remaining balance. However I do not know how to
display the results to 2 decimal places.

At this time all results are displayed as one big string in a large text box
with it's multi-line property set to true. I found something called a
format character but it didn't work in my code.

when I do this:
sResults = sResults + ("{0:N}", mAccruedInterest);

it gives me the squiggly red line under the comma and under mAccruedInterest
and it says ") expected", "invalid expression term ',' " and "; expected".

thanks
Nov 17 '05 #1
2 1598
"Gen" <wi*******@microsoft.com> wrote:
when I do this:
sResults = sResults + ("{0:N}", mAccruedInterest);
it gives me the squiggly red line under the comma


sResults = sResults + String.Format("{0:N}", mAccruedInterest);

P.
Nov 17 '05 #2
Gen
thanks, it works!

"Paul E Collins" <fi******************@CL4.org> wrote in message
news:dj**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
"Gen" <wi*******@microsoft.com> wrote:
when I do this:
sResults = sResults + ("{0:N}", mAccruedInterest);
it gives me the squiggly red line under the comma


sResults = sResults + String.Format("{0:N}", mAccruedInterest);

P.

Nov 17 '05 #3

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

Similar topics

16
by: Douglas | last post by:
Gday, How would I format a number so that: TheValue = 32500 Displays in the TextBox as: $32,500.00
2
by: John S | last post by:
I have created an event handler that is trying to format each number as it is typed. Example If the first char is 1 = output is $1.00 second char is 3 = output is $13.00 next is 5 = $135.00...
3
by: trint | last post by:
Ok, I have a textbox that I want to check as one types each charactor for Currency formatting, another one for Date formating. Any help is appreciated. Thanks, Trint
3
by: The Eeediot | last post by:
How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control? I know it's simple but I cannot find how to do this in any reference manual. TIA....
5
by: tshad | last post by:
I have a number with commas that a user may put into our textbox. The problem is I can't use this in my Sql Statement without an error: For example, if my variable is 12,000.00 or $12,000.00, I...
5
by: RR SPSCC | last post by:
I have a textbox bound to a dataview field. How can I format the value to display as currency? Thanks in advance.
6
by: Brad | last post by:
I guess I still have not grasped the logic of formatting a simple label or text box. Why would the following not work? I need the resulting label to display currency. lblAmtDue.Text =...
8
by: G.Ashok | last post by:
Hi, I have created CultureInfo object and specified required digit grouping in it. The one of the overloaded ToString methods of Decimal type has parameters to format the value with required...
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...
3
by: mracuraintegra | last post by:
I am seriously at my wits' end here with this. I've got a textbox bound to a money column in a database, but it shows up as a decimal value, meaning that $9.25 shows up as 9.250000. ARRRRG. ...
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: 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
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.