Recent

Author Topic: TDBGrid Display format "#,##0.00" broken?  (Read 10212 times)

Vingadero

  • New Member
  • *
  • Posts: 46
TDBGrid Display format "#,##0.00" broken?
« on: December 12, 2011, 07:42:20 pm »
Hello

I'm using Lazarus-0.9.31-34078-fpc-2.5.1-20111210-win32

Have a DBGrid who shows numbers in various currency formats Ex: '$###,##0.00' , '€###,##0.00'

So I change the DBGrid.Columns[X].DisplayFormat before show the data.

Also try change: TFloatField(FieldByName('vl')).DisplayFormat:= '###,##0.00';
Still don't work..

Another edit: DisplayFormat 'yyyy-mm-dd' for Date fields works fine

It was working fine on version 9.30.2..

Its broken for anyone else?

thx!!
« Last Edit: December 12, 2011, 07:49:57 pm by Vingadero »

Vingadero

  • New Member
  • *
  • Posts: 46
Re: TDBGrid Display format "#,##0.00" broken?
« Reply #1 on: December 14, 2011, 09:20:25 pm »
Attached an image that shows whats going on...

See that "dt" DisplayFormat: yyyy-mm-dd works perfect
but "vl" DisplayFormat: #,##0.00 don't...

Any help?!

thx alot

jesusr

  • Sr. Member
  • ****
  • Posts: 499
Re: TDBGrid Display format "#,##0.00" broken?
« Reply #2 on: December 15, 2011, 04:33:08 am »
here it works fine here using tdbf and TFloatField and TSmallInt, using Lazarus 0.9.31 r34164M FPC 2.7.1 i386-win32-win32/win64, what version of lazarus/fpc do you use? what kind of fields and database?

If you want to check in your current version, open the project at components/lazreport/samples/editor/ right click dbgrid and select columns, add a couple of columns and select PRICE and QTY fields, then set the display format one variant or your samples on each field and run it.

Vingadero

  • New Member
  • *
  • Posts: 46
Re: TDBGrid Display format "#,##0.00" broken?
« Reply #3 on: December 15, 2011, 05:21:23 am »
Hello, thx for reply

I'm using "Lazarus-0.9.31-34165-fpc-2.5.1-20111214-win32" from Daily Snapshots link.

And I'm using Sqlite

Where can I get your Lazarus version?

ty

jesusr

  • Sr. Member
  • ****
  • Posts: 499
Re: TDBGrid Display format "#,##0.00" broken?
« Reply #4 on: December 15, 2011, 07:38:41 pm »
you seems to be using a newer version than I, so you don't need a new version, have you tried the dbf test program I mention in my comment? does it work for you?.

sqlite seems to use some weird field handling, maybe Luiz can shed some light on this, Luiz ... ?

Vingadero

  • New Member
  • *
  • Posts: 46
Re: TDBGrid Display format "#,##0.00" broken?
« Reply #5 on: December 17, 2011, 01:16:30 pm »

 

TinyPortal © 2005-2018