Closed qdzo closed 2 years ago
@qdzo when you have a chance to test the implementation please get back to me so I can close the issue
Hi, @carbon-hvze . Thanks for fast feedback.
Checked implementation and found interesting issue with leading zeroes and trealing zeroes after dot.
Clojure's reader drop trailing zeroes, and leave only one before dot
10.000 -> 10.0
and also drops leading zeros.
0001 -> 1
and if we set :scale 2
or :precision 4
and pass value 10.00
validation will fail in both scenarios.
and with :precision 2
- if we pass 01
we also will get validation fail.
Maybe we need edge case here.
Everything else works great
after the discussion we agreed upon the following:
@qdzo hey please take a look at the trailing zeroes logic, if it suits your needs I will go ahead and close the issue
Tested. Everything as expected. Thanks.
nice! closing the issue then
We had to allow missing trailing zeroes after decimal point - because JSON remove all trailing zeroes and convert float to integer.
Example: 1.0 -> 1
And we don't have any way to prevent that behaviour.
1ee4d37afdb625db4d28202043f2d608631b91ec also related to this problem.
Fixed validation of integer value when have scale = 1
It is suitable to have constraints on decimal numbers like:
Or maybe add format like in "##.#"