@@ -800,12 +800,12 @@ generate_validator = function(ctx, schema)
800800 ctx :stmt (sformat ( ' local itemcount = #%s' , ctx :param (1 )))
801801 if schema .minItems then
802802 ctx :stmt (sformat (' if itemcount < %d then' , schema .minItems ))
803- ctx :handle_error (' ' , sformat (' "expect array to have at least %s items"' , math.floor (schema .minItems )), ' "/minItems"' , ' ""' )
803+ ctx :handle_error (' ' , sformat (' "expect array to have at least %s items"' , format_number (schema .minItems )), ' "/minItems"' , ' ""' )
804804 ctx :stmt ( ' end' )
805805 end
806806 if schema .maxItems then
807807 ctx :stmt (sformat (' if itemcount > %d then' , schema .maxItems ))
808- ctx :handle_error (' ' , sformat (' "expect array to have at most %s items"' , math.floor (schema .maxItems )), ' "/maxItems"' , ' ""' )
808+ ctx :handle_error (' ' , sformat (' "expect array to have at most %s items"' , format_number (schema .maxItems )), ' "/maxItems"' , ' ""' )
809809 ctx :stmt ( ' end' )
810810 end
811811 end
@@ -1052,7 +1052,7 @@ generate_validator = function(ctx, schema)
10521052 ctx :stmt (sformat (' if %s(quotient) ~= quotient or %s == quotient or %s == -quotient then' , ctx :libfunc (' math.modf' ), ctx :libfunc (' math.huge' ), ctx :libfunc (' math.huge' )))
10531053 end
10541054 ctx :handle_error (' ' , sformat (' %s("expected %%s to be a multiple of %s", %s)' ,
1055- ctx :libfunc (' string.format' ), mof , ctx :param (1 )), ' "/multipleOf"' , ' ""' )
1055+ ctx :libfunc (' string.format' ), format_number ( mof ), format_number ( ctx :param (1 ) )), ' "/multipleOf"' , ' ""' )
10561056 ctx :stmt ( ' end' )
10571057 end
10581058 ctx :stmt (' end' ) -- if number
0 commit comments