Android Question Problem with double

Discussion in 'Android Questions' started by eades, Mar 7, 2015.

  1. eades

    eades Member Licensed User

    Hi i have got a problem with my sql lite, when i get the value for an money field with getdouble i get a rounded value. The value in the database is 30,45 but i get with getdouble 30.0
    what am i doing wrong?
    I have tried the field as string and as real.
     
  2. klaus

    klaus Expert Licensed User

    Whithout seeing your code how do expect we could help?
    How do you get it, how do you display it etc. !
    It seems that somewhere you are using an Int !
     
  3. eades

    eades Member Licensed User

    sorry i thougt it was enough information without code.
    cursor.getdouble("price") gave me an rounded amount instead of the exact field value.
    i have found the problem, the database has values with the decimal separator , (komma) and must have an decimal separator . (dot)
     
  4. eades

    eades Member Licensed User

    I have changed the comma's in dots in de original database with delphi and now it's working perfect.
    the problem was not how to show it but several values had to be add up.
    thanks for your reply Klaus. Have a nice evening
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice