Thread: how to remove zero after decimal number

  1. #1
    Registered User
    Join Date
    Apr 2007

    how to remove zero after decimal number

    I want to make a function whic will remove all the tralling zeros from a numeric data type.

    Means i just want to pass the numeric data as an input and want the reslut like this:-

    1. Eg.:- 123.0000
    Relust:- 123

    2. Eg:- 123.0100
    Result:- 123.01

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Hannover, Germany

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to set a number of decimal spaces?
    By Diablo02 in forum C# Programming
    Replies: 2
    Last Post: 09-26-2007, 02:10 PM
  2. Prime number program problem
    By Guti14 in forum C Programming
    Replies: 11
    Last Post: 08-06-2004, 04:25 AM
  3. How to change the number of decimal???
    By zaestau in forum C++ Programming
    Replies: 5
    Last Post: 10-29-2003, 01:32 PM
  4. finding the decimal part of a number
    By Geo-Fry in forum C++ Programming
    Replies: 13
    Last Post: 07-31-2003, 12:43 PM
  5. converting a hex number to decimal???
    By Unregistered in forum Game Programming
    Replies: 8
    Last Post: 04-13-2002, 05:46 PM