Is there any documentation of the number format used by the quantity type?
Bumped into this and had to implement the BCmath extension to handle the
number. The reason why I did it (except it was fun) is to handle some weird
unit conversions. By inspection I found there were numbers at Wikidata that
clearly could not be implemented as doubles, and testing a little I found
that this had to be implemented as some kind of big numbers. Lua does not
have big numbers, and using the numbers from quantity as a plain number
type is a coming disaster.
So, is there any documentation for the quantity format anywhere? I have not
found anything. I posted a task about it, and please add info there if you
know where some info can be found. I suspect the format just happen to be
the same as BC, and nobody really checked if the format was compatible, or…?
The BCmath extension can be found at
-
https://www.mediawiki.org/wiki/Extension:BCmath
-
https://github.com/jeblad/BCmath
There is a Vagrant role if anyone likes to test it out.