[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2024-05-19 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #13 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/graphics/okular/-/merge_requests/992

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2024-01-16 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #12 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/graphics/okular/-/merge_requests/914

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-12-11 Thread Nicolas Fella
https://bugs.kde.org/show_bug.cgi?id=474661

Nicolas Fella  changed:

   What|Removed |Added

 CC||nicolas.fe...@gmx.de

--- Comment #11 from Nicolas Fella  ---
The form field has a AFNumber_Keystroke(2, 0, 0, 0, "", true) keystroke script
(that Okular doesn't implement, which is another bug in itself)

This means . is decimal and , is thousand separator.

Acrobat and Firefox don't even let me type in a comma, Chromium treats it as a
decimal separator.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-07 Thread Volker Krause
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #10 from Volker Krause  ---
(In reply to Albert Astals Cid from comment #8)
> The internet says it is a localized number
> 
> pdfium and pdf.js say "it doesn't matter, just replace the , to . and parse
> that" (with the understanding that there's no thousand separators i guess)

Indeed, assuming there are no group separators for all string to number
conversions fixes this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-07 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=474661

Bug Janitor Service  changed:

   What|Removed |Added

 Status|CONFIRMED   |ASSIGNED

--- Comment #9 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/graphics/okular/-/merge_requests/832

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-06 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #8 from Albert Astals Cid  ---
The internet says it is a localized number

pdfium and pdf.js say "it doesn't matter, just replace the , to . and parse
that" (with the understanding that there's no thousand separators i guess)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-06 Thread Volker Krause
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #7 from Volker Krause  ---
(In reply to Albert Astals Cid from comment #6)
> Are you asking about sepStyle in AFNumber_Format?

The output part of that is clear I think (and the implementation matches that),
the question is how the input should be interpreted in case of that being a
string rather than a number. The current implementation is using the current
locale format first, and then the alternate format. Unconditionally using the
English format would probably fix this, but the current logic presumably didn't
happen by accident, so there must be more to this.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-06 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #6 from Albert Astals Cid  ---
Are you asking about sepStyle in AFNumber_Format?

According to
https://acrobatusers.com/forum/javascript/setting-number-format-text-field/

sepStyle = separator style 
  0 = 1,234.56
  1 = 1234.56
  2 = 1.234,56
  3 = 1234,56

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-06 Thread Volker Krause
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #5 from Volker Krause  ---
It only triggers when the result has exactly three decimals, as only that
produces a string that can be misinterpreted as a value with a dot as group
separator instead of decimal separator.

This probably isn't even terribly hard to fix, the problem is I am not finding
the involved methods in the PDF JS API spec to know how exactly those are
supposed to behave.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-05 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #4 from andreaswu...@gmx.de ---
The strange thing is also, that it is not consistent

133.33 -> both 25% and 10% are properly calculated
133.34 -> 25% is calculated wrong
133.35 -> 10% is calculated wrong
133.36 -> both 25% and 10% are properly calculated

=> The decimal separator and the thousand separator are displayed properly when
you just enter "1000" and leave the field. 
Why the calculation does not work for some numbers i do not understand.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-10-05 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #3 from andreaswu...@gmx.de ---
Here the sake of completeness - my kde sponsored work entry: 

https://discuss.kde.org/t/bug-fix-fixing-okular-js-form-calculation-problems/5495

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-09-26 Thread Volker Krause
https://bugs.kde.org/show_bug.cgi?id=474661

Volker Krause  changed:

   What|Removed |Added

 CC||vkra...@kde.org

--- Comment #2 from Volker Krause  ---
This seems to happen only in locales with a comma as decimal separator. It
breaks when the string "33.335" is passed to JSUtil::stringToNumber(), which
results in the number 5 in a locale with a comma decimal separator, rather
than the expected 33.335, ie. this happens for numbers where the conversion is
ambiguous between different locales.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-09-18 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=474661

Albert Astals Cid  changed:

   What|Removed |Added

 Status|REPORTED|CONFIRMED
 Ever confirmed|0   |1
 CC||aa...@kde.org

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 474661] Norwegian withholding tax form - wrong calculation of percent value

2023-09-18 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=474661

--- Comment #1 from andreaswu...@gmx.de ---
Created attachment 161697
  --> https://bugs.kde.org/attachment.cgi?id=161697=edit
PDF document with the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.