File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ function sysFormFieldValidate()
4545 //- validate functions
4646 this . ValidateFunc =
4747 {
48+ 'Float' : this . Float ,
4849 'MinMax' : this . MinMax ,
4950 'MaxLength' : this . MaxLength ,
5051 'IPAddress' : this . IPv4Address ,
@@ -469,6 +470,27 @@ sysFormFieldValidate.prototype.DateGerman = function(Value)
469470}
470471
471472
473+ //------------------------------------------------------------------------------
474+ //- METHOD "Float"
475+ //------------------------------------------------------------------------------
476+
477+ sysFormFieldValidate . prototype . Float = function ( Value )
478+ {
479+ const ErrorMsgFloatFormat = sysFactory . getText ( 'TXT.SYS.ERROR.FORMVALIDATE.FLOAT-FORMAT-INCORRECT' ) ;
480+
481+ console . debug ( 'CheckFloat Value:%s' , Value ) ;
482+
483+ if ( Value . includes ( ',' ) || isNaN ( parseFloat ( Value ) ) ) {
484+ return {
485+ "Error" : true ,
486+ "Message" : ErrorMsgFloatFormat
487+ } ;
488+ }
489+
490+ return false ;
491+ }
492+
493+
472494//------------------------------------------------------------------------------
473495//- CONSTRUCTOR "sysFormFieldValidate"
474496//------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments