Howto decimal in lazreport as 0.## lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- liangby · 2009-12-09 07:39 In default, If vaule set as number type, lazreport show decimal as .##. But I want to show as 0.##. Any idea? ---------------------------------------------------------------------- Luciano · 2009-12-09 12:28 Hi.     I had serious problems with decimals, but I found the answer in forum threads. First, I had to find out how to solve the problem in dbedits and dbgrids, but they were in the reports. And found. I still have to solve another problem: how to resolve this in print, not the report, but the impression of a ticket ... So I will describe to you how to do this,    and ask you to help me (or other) about the printer: First declare one variable tfield in your procedure in formcreate or onshow. Second, the follow: f := table_or_query.fieldbyname('your_field'); if f <> nil then f.ongettext := mygettext; //in some cases this was accepted @mygettext In private declarations section declare the following procedure: procedure mygettext(sender: tfield; var atext: string; adisplayformat: boolean); This procedure have the following: atext := formatfloat(tnumericfield(sender).displayformat,sender.asinteger/100); In the display format field i put: #,###,##0.00 ---------------------------------------------------------------------- DougNettleton · 2009-12-09 20:01 Sorry, I don't understand this.  In the lazreport Designer, right click on the field, choose "Variable Format",  Choose "Number", "Custom" and enter #,##0.00.  Click OK. HTH, Doug ---------------------------------------------------------------------- liangby · 2009-12-10 00:53 Get it ! Thanks! ---------------------------------------------------------------------- Luciano · 2009-12-11 12:25 Hello! About the problem mentioned, with places in print, is resolved. var value_convert: variant; value_convert := table.fieldbyname('value').asfloat; value := format('%7.2n',[strtofloat(value)/100); printer.canvas.textout(800, linha, value); Have a nice day!