Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Decimal Point in C#


Decimal Point in C#

Author
Message
nicegal
nicegal
Forum God
Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)Forum God (3.1K reputation)

Group: Forum Members
Posts: 11, Visits: 17
Hello!



I have a double array, the problem is that I want the decimal to show even when the value is say "10", but it only shows decimal when there is actually something after the decimal point like it would show the value "10.02" but NOT "10.00". Can anyone help me with this???
Anasazi
Anasazi
Forum God
Forum God (31K reputation)Forum God (31K reputation)Forum God (31K reputation)Forum God (31K reputation)Forum God (31K reputation)Forum God (31K reputation)Forum God (31K reputation)Forum God (31K reputation)Forum God (31K reputation)

Group: Forum Members
Posts: 144, Visits: 536
Ok, I'm sorry but I have no idea of you're trying to say. Could you please be more specific or might give me some code? Smile Thanks.
So far, I have no problems getting a double array to show "full" numbers:

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
  double i;
  do {
         i += 0.01;
         cout << i << "";
  } while (i < 100);                                                                                                                          
}


Time is an illusion perpetuated by the manufacturers of space.

Anasazi @ RESiSTANCE


Edited
8/11/2007 by Anasazi
Bharathi
Bharathi
Forum God
Forum God (11K reputation)Forum God (11K reputation)Forum God (11K reputation)Forum God (11K reputation)Forum God (11K reputation)Forum God (11K reputation)Forum God (11K reputation)Forum God (11K reputation)Forum God (11K reputation)

Group: Forum Members
Posts: 74, Visits: 125
Hi,

Try this code.

int val = 28;

string formatted = val.ToString("N2");

 




Books for Programmers
http://www.vkinfotek.
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search