Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    39

    Unanswered: Number of decimals in SQL field

    Hi !

    How can I define the number of decimals in an SQL field ?

    I have a currency field (1 EUR = 0.82 USD) and an inverted currency field (USD 1.21 = 1 EUR)

    The trouble is that when I ask SQL to calculate 1/0.82 I get 1.2195122

    Any suggestion anyone ?

    Many thanks from Belgium

    John

  2. #2
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Hello,

    Use the ROUND function, for example :

    SELECT ROUND(1/0.82, 2) FROM DUAL;

    returns 1,22 (2 decimals)

    SELECT ROUND(1/0.82, 4) FROM DUAL;

    returns 1.2195 (4 decimals)

    Regards,

    RBARAER

  3. #3
    Join Date
    Sep 2004
    Posts
    39
    Many thanks RBARAER

    Have a cool week-end!

    John

Posting Permissions

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