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

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0

    Firebird numeric value 0.00


    hi
    a have a problem!
    i use firebird 2.5 and when i insert or update a record have following issue
    im my table i have 3 colums
    1 ID integer
    2 Name (varchar 50)
    3 Value (numeric 4,2)

    if the value is 0.00 then when i insert or update is stored 0 !!
    if the value is 4.00 then stored just 4 !!

    i want to have the full value 4.00!!!

    what should i do???
    thx
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    74
    Rep Power
    10

    Thumbs up


    All Float or Double number (value) is saved as BIGINT, INTEGER or SMALLINT (look in site FIrebirdSQL for FAQ about it).

    0 - 4 digits = smallint
    5 - 9 digits = integer
    10 - 18 digits = bigint

    in decimal representation ( n POWER x )

    But, you can to use the "MASK" for show the value as desired!

    Example in Delphi:

    Maskedit -> mask = ###,###,##0.0000

    Show: 999,999,999.9999 value
    Last edited by emailx45; September 21st, 2013 at 07:27 AM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0
    Originally Posted by emailx45
    All Float or Double number (value) is saved as BIGINT, INTEGER or SMALLINT (look in site FIrebirdSQL for FAQ about it).

    0 - 4 digits = smallint
    5 - 9 digits = integer
    10 - 18 digits = bigint

    in decimal representation ( n POWER x )

    But, you can to use the "MASK" for show the value as desired!

    Example in Delphi:

    Maskedit -> mask = ###,###,##0.0000

    Show: 999,999,999.9999 value

    thanks!!!
    you have right!!
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    19
    Rep Power
    0
    Another option is to cast it into the Numeric(14, 2) format in the select statement.

IMN logo majestic logo threadwatch logo seochat tools logo