obsidian-solve icon indicating copy to clipboard operation
obsidian-solve copied to clipboard

[Bug] Decimal places are ignored when using non-ENG decimal separator (",")

Open esamecar opened this issue 8 months ago • 2 comments

Describe the bug Calculation (sum) of floats with decimal separator set to non-ENG does not work.

The decimal places are ignored if you use ",". That means the values after the separator are ignored and not used for calculation.

Addition with numbers that contain a non-ENG thousands separator, which is used as a decimal separator in ENG ("."), on the other hand, leads to correct results, even if the separator is placed in the wrong position. It is therefore not used as a decimal separator, as desired.

To Reproduce Steps to reproduce the behavior:

In plugin settings set Decimal seperator to Non English and use 2 Decimal places.

CleanShot 2024-05-24 at 09 12 36

CleanShot 2024-05-24 at 09 12 19

In a note type

100 +3
100,4 + 3,4
100.4 + 3.4

Expected behavior

100 +3 = 103
100,4 + 3,4 = 103,8
100.4 + 3.4 = 1038

Screenshots instead you get this: CleanShot 2024-05-24 at 09 11 51

Obsidian

  • Version: macOS
  • Platform: Desktop

Additional context Thanks for the awesome plugin.

esamecar avatar May 24 '24 07:05 esamecar