Modify code to display cents

Need help to modify code so it doesn't round cents.

Me.TextBoxPOTotal.Text = CInt(TextboxGA.Text + CInt(TextboxTA.Text + CInt(TextboxRA.Text + CInt(TextboxFA.Text))))
            Me.TextBoxPOTotal.Text = Double.Parse(TextBoxPOTotal.Text).ToString("N2")

Thanks!
dave_skyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Najam UddinCommented:
 Double.Parse(TextBoxPOTotal.Text)("0.##"); 

Open in new window


If also want to round it 2 decimal places
Math.Round(a, 2);

Open in new window

where a is double
dave_skyAuthor Commented:
I tried the code change and it would not work.
Najam UddinCommented:
Be little more elaborate on what part didn't worked?
What is result of this line
Me.TextBoxPOTotal.Text = CInt(TextboxGA.Text + CInt(TextboxTA.Text + CInt(TextboxRA.Text + CInt(TextboxFA.Text))))

Open in new window


If you are getting integer here , how can that be converted to decimal, if you convert this to decimal it will XXXX.00
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

dave_skyAuthor Commented:
It's this part of the code that is not displaying cents:
Me.TextBoxPOTotal.Text = Double.Parse(TextBoxPOTotal.Text).ToString("N2")

It displays: 100.00 if I want 100.23 to display...
Najam UddinCommented:
Again what is result of this

Me.TextBoxPOTotal.Text = CInt(TextboxGA.Text + CInt(TextboxTA.Text + CInt(TextboxRA.Text + CInt(TextboxFA.Text))))

Open in new window


You are making integer in this line, inplace of Cint, parse them double
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I think what Najam means is that this line:

Me.TextBoxPOTotal.Text = CInt(TextboxGA.Text + CInt(TextboxTA.Text + CInt(TextboxRA.Text + CInt(TextboxFA.Text))))

Will convert the value in TextboGA, TextboxTA, TextboxRA and TextboxFA to an Integer, which has no decimal places. So if you have 10.15, 10.22, 10.33 and 10.44 in those textboxes, the result would NOT be 41.14 as you would expect, it would 41 - the CINT call basically strips off any decimals. So trying to round that to 2 decimal places would give you 41.00.

Instead, use CDbl:

Me.TextBoxPOTotal.Text = CDbl(TextboxGA.Text + CDbl(TextboxTA.Text + CDbl(TextboxRA.Text + CDbl(TextboxFA.Text))))

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dave_skyAuthor Commented:
Excellent, Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.