CrossView cell formatting

Hi,

I have a crossView that I am loading from a string grid. I need to set the formatString to '%2.0m' for any cell that has a float value in it. I tried the following in the OnPrintCell event:
if (rowIndex < Cross1.rowCount - 1) and (columnIndex > 1 ) then
              begin
                  if (value <> '') and (ValidFloat(value)) then                                                                                                                                                                                                          
                       Memo.Text := Format('%2.0m',[value]) ;                                                                                                     
              end ;                                                        


When I run the report I get an Error: "... EConvertError with message 'Format '%2.0m' invalid or incompatible with argument'.


Thanks,
Bob

Comments

  • gpigpi
    edited 2:36PM
    Use
    if (rowIndex < Cross1.rowCount - 1) and (columnIndex > 1 ) then
    begin
    if (value <> null) and (ValidFloat(value*1.00)) then
    Memo.Text := Format('%2.0m',[value*1.00]);
    end;
    

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.