Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Number Format

Author  Topic 

kris55
Starting Member

6 Posts

Posted - 2007-04-19 : 13:53:19
Hello Folks,

I have some problem with converting the number format

I am getting the out put cNumber in the format of lets say 525.50
I want to eliminate the dot and the out put should be 52550
could not able to eliminate the dot. can any one help on this
i am using VB.NET
Thx

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-04-19 : 14:05:40
Are you having trouble with basic multiplication? No offense, but elementary math skills are pretty important for anyone writing any programming code in any language.

To "magically transform" 525.50 to 52550 you just multiply 252.50 525.50 by 100. Do you know how to do multiplication in VB.NET ? You use the * symbol, the same way you use + to add two numbers.

If you need something else, you need to be much more specific.

edit: fixed typo, thanks Jon!

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

kris55
Starting Member

6 Posts

Posted - 2007-04-19 : 14:29:40
quote:
Originally posted by jsmith8858

Are you having trouble with basic multiplication? No offense, but elementary math skills are pretty important for anyone writing any programming code in any language.

To "magically transform" 525.50 to 52550 you just multiply 252.50 by 100. Do you know how to do multiplication in VB.NET ? You use the * symbol, the same way you use + to add two numbers.

If you need something else, you need to be much more specific.

- Jeff
http://weblogs.sqlteam.com/JeffS




Hello Sir,
I know this basic thing. But in my sql table the data type is money. I tried dividing by 100 but it didn't do it
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-04-19 : 15:19:23
You need to MULTIPLY it by 100. Not divide. MULTIPLY. That is the OPPOSITE of divide.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

jhermiz

3564 Posts

Posted - 2007-04-19 : 16:08:49
quote:
Originally posted by jsmith8858

Are you having trouble with basic multiplication? No offense, but elementary math skills are pretty important for anyone writing any programming code in any language.

To "magically transform" 525.50 to 52550 you just multiply 252.50 by 100. Do you know how to do multiplication in VB.NET ? You use the * symbol, the same way you use + to add two numbers.

If you need something else, you need to be much more specific.

- Jeff
http://weblogs.sqlteam.com/JeffS




I cant help but to laugh at that Jeff.
Since when was 252.50 * 100 = 52550

Let me guess: Typo


Programmers HowTo's -- [url]http://jhermiz.googlepages.com[/url]
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-04-19 : 16:30:07
hehe, yeah, typo! Good catch!!!!

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -