zilav Posted March 29, 2016 Posted March 29, 2016 I have FormatSettings.DecimalSeparator = ',' but UniDBGrid insists on displaying float field values using dot '.' to separate decimals. What should I put into UniDBGrid.WebOptions.DefaultFloatFormat to make it use comma? Obvious values like '0,0' doesn't change anything. Quote
x11 Posted October 6, 2020 Posted October 6, 2020 may be formating in TDataSet.TField.DisplayFormat Quote
x11 Posted October 6, 2020 Posted October 6, 2020 On 3/29/2016 at 4:06 PM, zilav said: make it use comma you need to replace thousandSeparator and decimalSeparator https://forum.sencha.com/forum/showthread.php?192156-How-do-I-format-the-display-of-a-number-field-in-a-form&p=771059&viewfull=1#post771059 but i don't know how to do it in uniGUI sorry Quote
Abaksoft Posted October 6, 2020 Posted October 6, 2020 3 hours ago, x11 said: but i don't know how to do it in uniGUI The Correct place to put FormatSetting is on ServerModule Initialization Section : procedure TUniServerModule.FirstInit; begin InitServerModule(Self); end; initialization // correct place to initialize global FormatSettings parameters //******************************************** UniGuiApplication.PFmtSettings.CurrencyString := '€'; UniGuiApplication.PfmtSettings.CurrencyFormat:=3; // See F1 CurrencyFormat 0 = €1 1 = 1€ 2 = € 1 3 = 1 € UniGuiApplication.PfmtSettings.DecimalSeparator :='.'; UniGuiApplication.PfmtSettings.ThousandSeparator:=' '; UniGuiApplication.PfmtSettings.DateSeparator := '/'; UniGuiApplication.PfmtSettings.ShortDateFormat:='dd/MM/yyyy'; UniGuiApplication.PfmtSettings.TimeSeparator :=':'; UniGuiApplication.PfmtSettings.LongTimeFormat :='hh:nn:ss'; UniGuiApplication.PfmtSettings.ShortTimeFormat:='hh:nn:ss'; //******************************************** // IMPORTANT !!! // AFTER in the code for all functions : StrToFloat, FloatToSrt, DateToStr, ... // Must have FmSetting : // StrToFloat(ch, UniGuiApplication.FmtSettings) , ... // DateToStr(madate, UniGuiApplication.FmtSettings) // Example : v:=StrToFloat(St, UniGuiApplication.FmtSettings); RegisterServerModuleClass(TUniServerModule); end. 1 Quote
Administrators Farshad Mohajeri Posted October 6, 2020 Administrators Posted October 6, 2020 http://www.unigui.com/doc/online_help/formatsettings-.htm Quote
Abaksoft Posted October 7, 2020 Posted October 7, 2020 Mmm... Erratum : The Correct place to put FormatSetting (if the application is aimed at a large audience) is on MainModule Create Section as have described Farshad. Effectively, each session will have its own format. So, we can have a Brazilian user, an Arabic user and so... Thank you Farshad. Quote
x11 Posted November 6, 2020 Posted November 6, 2020 Sorry, but not work in server module initialization UniGuiApplication.PfmtSettings.ThousandSeparator := ' '; print screen from TUnimDBListGrid Quote
alfr Posted November 6, 2020 Posted November 6, 2020 I set the PFmtSettings.ThousandSeparator:=' '; in MainModule for the user but then activate the format in the undDbGrid by setting the DisplayFormat of the field in the Query linked to the grid. So to activate the thousand seperator here use #,### or #,##0 or similair... Quote
x11 Posted November 6, 2020 Posted November 6, 2020 1 hour ago, alfr said: undDbGrid sorry, but i need in TUnimDBListGrid Quote
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.