1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Format problem

Discussion in 'Questions (Windows Mobile)' started by ArturAs, Mar 29, 2009.

  1. ArturAs

    ArturAs New Member Licensed User

    Why does Format(0.567,"F0") return 1? I would expect 0

    The value seems to be rounded before formatting:
    Format(0.467,"F0") brings 0

  2. specci48

    specci48 Well-Known Member Licensed User

    It's true that the format function rounds the value before formatting.

    So what is the aim of your expected format? If you want only the value before the decimal point use
    Int(0.567) => returns 0
    Int(0.467) => returns 0
    Int(1.000) => returns 1

  3. ArturAs

    ArturAs New Member Licensed User

    Thank you, specci48,
    i'll use this way.
  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