Jump to content
uniGUI Discussion Forums

DefaultFloatFormat in UniDBGrid


Recommended Posts

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.

Link to post
Share on other sites
  • 4 years later...
  • 1 month later...
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.

 

 

  • Like 1
Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...