vsirotin / si-units

Kotlin function and objects for working with SI units like meter, second, as well as currencies and general units like percent.

Home Page:https://vsirotin.github.io/si-units/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New solution for result formatting

vsirotin opened this issue · comments

Current implementation of show() is not works on Multiplatform.

Nice 👍

Hi @michalharakal
After many experiments on different platforms I found out that all possible own "pure" Kotlin solutions or solutions in "multiplatform-still" depend on so called locals and rounding arithmetic on given platform.
That means, there will always be situations, that results of Expression.show() and Expression.toString() will be different on different platforms.
As a consequence, I first decided to remove the Expression.show() method from the library. Besides, I also decided to remove cross-platform tests for toString() as well.
This means among other things that the major version will be increased.
In the future it is possible that for certain platforms platform-dependent functions and their tests will be implemented.

This is completely fine to have a different behavior on different platforms. You can also have platform specifics test for that running only with that platform.