FormatFloat d'ont work?

I need to format a float Tfield, but d'ont know because d'ont work.

I put the next script code in the OnBeforePrint event of a Detail Band, but alway print without decimal numbers.

if ([datam.cds."FLOATVAR"] <> null) then
memo1.memo.text := FormatFloat('#,##0.00;;0.00', [datam.cds."FLOATVAR"]))
else
memo1.memo.text := 'Null';


I try too simple '#,##0.00', but print the same results.

Help me, please!!!

Comments

  • SamuraySamuray Administrator
    edited November 2003
    1.
    Don't use construction:
    if ([datam.cds."FLOATVAR"] <> null) then // wrong code

    use this code:
    if not FieldIsNull('datam.cds."FLOATVAR"') then // right code


    2. What decimal separator you use?
  • edited November 2003
    -> 2. What decimal separator you use?
    The <span style='font-size:21pt;line-height:100%'>,</span> character, Configured in Operating System Internacional Settings.
    If I see the value in the database it's with comma too. Example 1000,12

    I try too whit #.##0,00, but I get the same bad result




    I d'ont know that exist FieldIsNull function in script mode.
    In FR2.4 Manual in the "List of functions" d'onts exist.
    Where can I get the last version manual or a renewed List of functions.

    Thanks Samuray
  • SamuraySamuray Administrator
    edited 2:19PM
    FieldIsNull new function (from 2.5)
    See undocumented.chm (in 2.51) for details.
    New documentation coming soon.
  • edited 2:19PM
    About the formatfloat problem ...

    Can you give some clue?

    Thanks Samuray
  • SamuraySamuray Administrator
    edited 2:19PM
    Send me please your report .frf file. I want to look on this problem in current report ... ;)
  • edited 2:19PM
    RESOLVED!!!

    I used this new code:
    if ([datam.cds."FLOATVAR"] <> null) then
      [VARMEMO1] := FormatFloat('#,##0.00;;0.00', [datam.cds."FLOATVAR"]))
    else
      [VARMEMO1] := 'Null';
    

    I use VARMEMO1 as variable-scritp and this it's attached to a Memo Object.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.