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