Results 1 to 3 of 3

Thread: C# Numeric problem

  1. #1

    Thread Starter
    Lively Member fifo's Avatar
    Join Date
    Dec 2005
    Location
    HaiPhong, Vietnam
    Posts
    77

    C# Numeric problem

    Hi, Experts

    I have a single number A = 1.9E+28, I want convert it to String by using

    String B = A.ToString() ;

    B will be "1.9E+28"

    BUT I want to show B like B = "19000000....000" <---- 27 digit 0.

    How can I do? Show me.
    !Have fun!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: C# Numeric problem

    Code:
    String B = A.ToString("f0");
    "f0" means fixed-point with zero decimal places. Look up format strings on MSDN for more info.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member fifo's Avatar
    Join Date
    Dec 2005
    Location
    HaiPhong, Vietnam
    Posts
    77

    Re: C# Numeric problem

    Nice, thanks
    !Have fun!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width