likemike Posted March 3, 2021 Share Posted March 3, 2021 Hello! The title says it all. The displayformat of my field in the query is "#####0.00" Examples: Input Output 12,34 1234,00 12.34 1234,00 To make it work, I have to delete the InputType. Regards Mike Link to comment Share on other sites More sharing options...
Sherzod Posted March 5, 2021 Share Posted March 5, 2021 On 3/3/2021 at 9:27 PM, likemike said: The title says it all. The displayformat of my field in the query is "#####0.00" Examples: Input Output 12,34 1234,00 12.34 1234,00 To make it work, I have to delete the InputType. Hello, Sorry, what's the issue? Link to comment Share on other sites More sharing options...
likemike Posted March 6, 2021 Author Share Posted March 6, 2021 Hello! OK - I try it with other words. What I need is a DBEdit field, which is binded to a database TFloatField (it's an amount field and not a currency field!) and which allows me to input values like 1234,56 or 1234.56 I've tried UnimDBEdit with InputType = number. -> that doesn't work, because I always get integer values (the decimal point is ignored). I've tried UnimDBNumberEdit -> that doesn't work, because I only get the numbers 0..9 on the touch-keyboard (no decimal point!). So the problem is, that the UnimDB components are ignoring the "Precision" value of the TFloatField. BTW: when I set "Currency" to true I get the right result, but with the currency unit. Thanks Mike Link to comment Share on other sites More sharing options...
likemike Posted March 7, 2021 Author Share Posted March 7, 2021 Hello! I've found the reason for my problem, but no solution. The reason is: In UnimDBEdit (UnimDBNumberEdit) these properties are missing: property DecimalUseOSDefault; property DecimalPrecision; property DecimalSeparator; while in UniDBEdit (UniDBNumberEdit) they exist. So it would be nice, if these properties are added in the next release. Regards Mike Link to comment Share on other sites More sharing options...
x11 Posted April 19, 2021 Share Posted April 19, 2021 On 3/5/2021 at 8:26 PM, Sherzod said: Sorry, what's the issue? Проблема в том, что непонятно какой разделитель DecimalSeparator правильно использовать на FrontEnd (в браузере): точку или запятую. Обратите внимание на картинку 1. На десктопе - запятая, а в мобильной версии - точка. А на картинке 2 тоже мобильная платформа, но уже значение с запятой. Т.е. нет однозначного правильного значения. На BackEnd все понятно, там есть FormatSettings и все зависит от настроек операционной системы. Например, у меня есть TUnimEdit, где inputType = number и мне нужна компонента именно TUnimEdit. код для мобильной платформы: UnimEdit1.Text := FloatToStr(DataSet1.Fields[10].AsFloat);// значение "2,99" - работает или UnimEdit1.Text := DataSet1.Fields[10].AsString;// значение "2,99" - поле в браузере будет пустым Но вопрос в том: как правильно и от чего зависит? От браузера, от настроек фреймворка extJS. Если от настроек фреймворка extJS, то где эти настройки посмотреть, изменить? Этот код для фронтэнда или для бэкэнда: UniGuiApplication.PfmtSettings.DecimalSeparator :='.'; И еще. Чем отличается - uniGUIApplication.FmtSettings от uniGUIApplication.PFmtSettings? В справке пусто: http://www.unigui.com/doc/online_help/api/uniGUIApplication_PFmtSettings.html http://www.unigui.com/doc/online_help/api/uniGUIApplication_FmtSettings.html Link to comment Share on other sites More sharing options...
x11 Posted December 19, 2021 Share Posted December 19, 2021 On 4/19/2021 at 3:08 PM, x11 said: Проблема в том, что непонятно какой разделитель DecimalSeparator правильно использовать на FrontEnd (в браузере): точку или запятую. вопрос все еще актуален Link to comment Share on other sites More sharing options...
likemike Posted December 19, 2021 Author Share Posted December 19, 2021 +1 Link to comment Share on other sites More sharing options...
Tokay Posted December 20, 2021 Share Posted December 20, 2021 As far as I understand the clients uses local decimal separate options. Depends on what is set in the user's system/browser. Link to comment Share on other sites More sharing options...
Tokay Posted December 20, 2021 Share Posted December 20, 2021 As far as I understand FmtSettings and PFmtSettings is the same things. But second is pointer to FmtSettings: PFmtSettings: PFormatSettings; FmtSettings: TFormatSettings; Found in samples: procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject); begin with PFmtSettings^ do begin DateSeparator:='/'; CurrencyFormat:=0; CurrencyString:='$'; end; end; Link to comment Share on other sites More sharing options...
likemike Posted December 20, 2021 Author Share Posted December 20, 2021 The real problem is, that the component UnimNumberEdit doesn't work as expected. When you set decimals to 2 the virtual keyboard on the mobil device only shows the numbes 0-9 without decimal point or comma. So it's impossible for the end user to fill in a decimal number like 123,45. I cannot understand, why it takes so long to fit this bug. 1 Link to comment Share on other sites More sharing options...
Oliver Morsch Posted December 22, 2021 Share Posted December 22, 2021 On 12/20/2021 at 4:33 PM, likemike said: The real problem is, that the component UnimNumberEdit doesn't work as expected. When you set decimals to 2 the virtual keyboard on the mobil device only shows the numbes 0-9 without decimal point or comma. So it's impossible for the end user to fill in a decimal number like 123,45. I cannot understand, why it takes so long to fit this bug. With which mobile device did you test? Link to comment Share on other sites More sharing options...
likemike Posted December 22, 2021 Author Share Posted December 22, 2021 2 hours ago, Oliver Morsch said: With which mobile device did you test? iPhone 11 Link to comment Share on other sites More sharing options...
Oliver Morsch Posted December 22, 2021 Share Posted December 22, 2021 13 minutes ago, likemike said: iPhone 11 I had similiar Problems with a real App and some Samsung phones. Installing another keyboard solved it. Link to comment Share on other sites More sharing options...
likemike Posted December 22, 2021 Author Share Posted December 22, 2021 29 minutes ago, Oliver Morsch said: I had similiar Problems with a real App and some Samsung phones. Installing another keyboard solved it. OK, but I cannot say to every customer, that he has to install another keyboard. Link to comment Share on other sites More sharing options...
Recommended Posts