Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

displayformat for floating value

edited March 2004 in General
assume displayformat is ,0.00 and the floating point value has 3 decimal
place, then rounding will occur, but how is it round? (In Delphi, there is
function roundto and simpleroundto with different logic of rounding, how
about displayformat in reportbuilder?)

Comments

  • edited March 2004
    Hi,

    ReportBuilder uses the Delphi method FormatFloat to handle the display
    format of numerical values. The following quote was taken directly from the
    Delphi Help under the FormatFloat topic.

    "The number being formatted is always rounded to as many decimal places as
    there are digit placeholders ('0' or '#') to the right of the decimal point.
    If the format string contains no decimal point, the value being formatted is
    rounded to the nearest whole number."

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    I set the displayformat property of a dbtext field to $,0.00 but the output
    always is 'HK$' instead of '$' only, I think this may be due to regional
    settings of OS, but is there any method to override it and use '$' only

  • edited March 2004
    Hi,

    By definition, ReportBuilder will use the Windows regional settings when
    defining a display format. You can always force a certain characters to
    show up in your display format by surrounding them in double or single
    quotes. For instance if you set your display format to: #,'$'0.00 The
    number 34.34 would show up as $34.34.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    I have try this but the result is still 'HK$34.34', if replace the '$' with
    'S', then it will shown S34.34 as expected.
  • edited March 2004
    Hello,

    This is interesing... it seems to work correctly on my machine. You may
    need to go into the ppDisplayFormat.pas file and change the way
    ReportBuilder formats its currency values.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.