DeHeus Posted April 26, 2018 Share Posted April 26, 2018 I'm developing in .NET for 10 years, but I'm pretty new to Delphi (developing about a year), and even more new to UniGui, so forgive me if it's a basic question. What is the best way to format the text displayed in a TUniDBText? I've a couple of TUniDBText fields on my form, all bound to seperate float fields of the same Datasource. I want the numbers to be displayed with 2 decimal characters. How can I achieve this? When there are multiple options what are pro's and con's of each solution. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 26, 2018 Share Posted April 26, 2018 Hi, Thank you for your interest in UniGUI! You can use DisplayFormat of TFloatField, for example: DisplayFormat -> '#.00' Quote Link to comment Share on other sites More sharing options...
DeHeus Posted April 26, 2018 Author Share Posted April 26, 2018 Thanks for your answer, I've got it working. As columns are created at runtime I've implemented it in the AfterOpen event. procedure TfrmTestForm.qryItemAfterOpen(DataSet: TDataSet); begin inherited; TFloatField(qryItem.FieldByName('FloatField1')).DisplayFormat := ',0.00'; // some more columns end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.