Hi.,
i need to make following in vb.net
I want to make the decimal type s=1 to be diaplyed with 1.00
if i give s=1.00 it takes as such ., but if i give s=1 ., it not providing as 1.00..
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Datta KharadPosted Nov 18, 2011, 1:54 AM
You need to take datatype as Double or float, see below example:
double dc = Convert.ToDouble(textBox1.Text);
float ft = Convert.ToSingle(textBox2.Text);
If Enter number in TextBox1=2 and TextBox2 =3:
Output is 2.0 and 3.0
VulpesPosted Nov 18, 2011, 4:49 AM
The code in VB.NET would be something like this:
Satyapriya NayakPosted Nov 18, 2011, 1:43 AM
Please refer the below link
http://idealprogrammer.com/net-languages/code-samples/cdec-syntax-vbnet-aspnet-cdec-source-code/
Thanks
Karthik AgarwalPosted Nov 18, 2011, 1:42 AM
Console::Write("{0:f2} ", (flaot)val);