Recent

Author Topic: DisplayFormat property bug?  (Read 3364 times)

kpeters58

  • Sr. Member
  • ****
  • Posts: 267
DisplayFormat property bug?
« on: April 08, 2013, 09:49:19 pm »
Can anyone confirm this?

TField's Displayformat '###,###,##0.00' displays doubles correctly if positive, negative numbers are displayed in TDBgrid incorrectly; i.e. -400 displays as ',-400.00'.

Somehow the determination of whether the rightmost thousand separator should be shown goes awry when values are negative.

V 1.1 SVN 39757
« Last Edit: April 09, 2013, 03:36:06 am by kpeters58 »
Lazarus 2.0.4/FPC 3.0.4/Win 64

Lacak2

  • Guest
Re: DisplayFormat property bug?
« Reply #1 on: April 09, 2013, 08:38:53 am »
Can you reproduce it with?:
writeln(formatfloat('###,###,##0.00', -400.00));

What type is TField ?
ftFloat, ftBcd or ?

denver

  • Jr. Member
  • **
  • Posts: 67
Re: DisplayFormat property bug?
« Reply #2 on: April 09, 2013, 01:49:21 pm »
You should use '###,###,##0.00;-###,###,#00.00' as Displayformat

First one is positive number format and the format after ';' is for negative number .

 

TinyPortal © 2005-2018