Numeric Format Strings:R


using System;
using System.Text;
using System.Globalization;
class Sample
    public static void Main()
        Console.WriteLine("{0:R}", 1f / 3f);

The output:


For the float and double types.

R squeezes out all digits to ensure ex- act round-tripping.  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.