Jump to content

Recommended Posts

Posted

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.

  • 4 years later...
  • 1 month later...
Posted
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
Posted

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.

  • 5 weeks later...
Posted

Sorry, but not work

in server module

initialization
  UniGuiApplication.PfmtSettings.ThousandSeparator := ' ';

print screen from TUnimDBListGrid

Screenshot_28.jpg

Posted

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...

image.png.154bc851092bfdc912721ccc1607e74a.png

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...