hi,, it seems thet i am posting too much inthe forum .what to do.i am busy with a project to finish..

ye, i just wanted to ask

i have a money datatype in my table SPAINFO in sql server2005

i have done the connectin and its working fine..

the problem is thet money datatype is displayed in my form like 20.0000 with four zeroes after the period . i want to remove the zeroes after the period when it is bound to my forms textbox.

Recommended Answers

All 2 Replies

use formatting

//you set your data here
decimal numValue = 20.0000;

//format it here
string num = String.Format("{0:C}", numValue);
this.textbox.Text = num;

how about a simple Convert.ToDouble(yourVar) for a 20,00 or a Convert.ToInt32(yourVar) for a round 20?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.