Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread TEdit displaying currency with 2 decimal places
Wed, Aug 16 2017 11:12 PMPermanent Link

Coullie

Hi Just started with Web Elevate so still finding my way around
I have a TEdit connected to a double datatype field. if the value is 50.00 it displays 50
Without using FloatToStrFormat is there a way to display 2 decimal places
Much Appreciated
Thu, Aug 17 2017 7:41 AMPermanent Link

Matthew Jones

Coullie wrote:

> Without using FloatToStrFormat is there a way to display 2 decimal places

Not that I'm aware of. I use the enter/exit to set the text according to how I want it displayed, along with an onChange to store the value into the "backing variable". So normally it can show "12.34" but when the user edits it changes to "12.3456" or whatever the real value is.

--

Matthew Jones
Thu, Aug 17 2017 7:43 AMPermanent Link

Uli Becker

> I have a TEdit connected to a double datatype field. if the value is 50.00 it displays 50
> Without using FloatToStrFormat is there a way to display 2 decimal places

Which database are you using? In EDB e.g. I use a "decimal" type
(scale=2) instead of "float" for currency values.
Not at my computer, but that should be displayed correctly in EWB as well.

Uli
Thu, Aug 17 2017 1:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Coullie,

<< Hi Just started with Web Elevate so still finding my way around
I have a TEdit connected to a double datatype field. if the value is 50.00 it displays 50
Without using FloatToStrFormat is there a way to display 2 decimal places >>

At this time you still need to use these event handlers for columns in order to provide formatting for data-bound controls:

https://www.elevatesoft.com/manual?action=viewevent&id=ewb2&comp=TDataColumn&event=OnGetText
https://www.elevatesoft.com/manual?action=viewevent&id=ewb2&comp=TDataColumn&event=OnSetText

Improving the data-bound formatting capabilities is high on the list of enhancements, so it won't be much longer to wait until this is completely addressed.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Aug 17 2017 6:33 PMPermanent Link

Coullie

Thanks to all

I used the OnGetText Event

Works a dream.
Image