Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 29 Mar 2024, 08:37

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 14 Dec 2021, 17:37 
Offline

Joined: 26 May 2014, 13:06
Posts: 11
Hello,

I am using DBGridEh with STFilter local = True, and Display Format (#.##) for float fields. But I have troubles when the value field has more than two decimal places and i'm trying to filter it.

Exemple:
Field value: 1.123
Value in DBGridEh with display format: 1.12
If i try to filter this column with 1.12 my return is void.

Is there any method to do this?

I'm using EhLib 9.3.026 and Delphi 2010.

Thank you


Top
 Profile  
 
PostPosted: 14 Dec 2021, 22:41 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello.

If you mean the ability to compare two numeric values
which would compare numbers only up to the second decimal place, then there is no such function in the library.

I recommend you several ways to work around this problem:

---
1. Introduce a separate concept of viewing and the concept of filtering.
In view mode, numbers are rounded to the second decimal place, but the filter is not available.
In filtering mode, a filter is available, but the column displays numbers without rounding.

The user switches the desired mode by pressing the button.

---
2. Create a separate column which will store numbers rounded to the second decimal place. Make this column available for filtering.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group