setprecision(2), fixed, CLR

I don't know how to do this in C++ CLI/CLR... Trying to format a decimal. I have something like 85.948492834743 in a label. I want it to just be "85.95" anyone know how to do this?
closed account (1vRz3TCk)

See: Standard Numeric Format Strings at MSDN
http://msdn.microsoft.com/en-us/library/dwhawy9k(v=VS.85).aspx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "stdafx.h"

using namespace System;
using namespace System::IO;

int main(array<System::String ^> ^args)
{
    System::Double dec = 85.948492834743;
    System::String ^ str = dec.ToString("N2");

    Console::WriteLine(str);
   
    return 0;
}
Topic archived. No new replies allowed.