#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    2
    Rep Power
    0

    Problem with ROUNDING a number


    Hi folks,

    I donīt why, but if i type in a TEdit object, for example, the number 1,223344, when i exit from that TEdit object and go to the other (by pressing TAB or ENTER), that number is automatically converted to 1,223300...

    I see that Delphi is rounding that number, but i donīt need it... I want the whole number (infinit number). I just donīt want that the program ROUND that...

    Is there anyway to do that number (1,223344) appears like 1,2233 but, internally, in the program memo, is saved like 1,223344?

    Thx. for now.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    2
    Rep Power
    0
    I took some screenshots to clear my question.

    This is my program: (see the screenshot - http://www.rodriguessilva.com.br/mack/1.gif).

    As you can see, there is 2 TEdit objetcs, 1 button and 1 panel.
    I want to type, for example, the number 1,223344 in the first TEdit object (see screenshot - http://www.rodriguessilva.com.br/mack/2.gif). Ok, i typed this, but see what happens when i exit from that TEdit and go to other (see screenshot - http://www.rodriguessilva.com.br/mack/3.gif).

    Did you see that it automatically converts that number (1,223344) to 1,223300... In other words, DELPHI is rounding my number and donīt like it... Iīd like to know a way to just show 1,2233 but the program RECORDS 1,223344 (and not 1,223300 as it does).

    I hope that it help a little...
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,624
    Rep Power
    4247
    TEdit doesn't change anything entered into it, unless you explicitly change it yourself (either by typing or by code). I'm guessing you have an OnExit() or OnChange() handler there that edits it for you.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo