Page MenuHomePhabricator

"Cannot accept donations greater than 12,000" error message has a rounding error in Malaysia
Closed, ResolvedPublic

Description

Summary:
The error message that appears when a user enters an amount greater than 12,000 USD to donate has a rounding error that causes the MYR conversion to appear as 49800.00000000001 MYR.

Steps to Reproduce:

  1. Open https://en.wikipedia.org/wiki/wikipedia?banner=B1920_0301_mlWW_dsk_p1_lg_cnt&country=MY
  2. Select "Other" in the "Select an amount" section of the banner and enter "444444" into the "Other" field
  3. Observe error message that appears at the bottom includes a rounding error

Expected Results:
We would expect the error message to not include such a large number of decimal places.

Actual Results:
Error message currently displays 10 decimal places in Malaysia

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 26 2020, 7:10 PM
jbolorinos-ctr triaged this task as Medium priority.Feb 26 2020, 7:14 PM

Updating priority to Medium as this will be affecting a single country in the upcoming Big Bundle campaign

Pcoombe claimed this task.Feb 27 2020, 4:33 PM
Pcoombe added a subscriber: Pcoombe.

Ah, good old floating-point arithmetic. Fixed with this change in CoreJS which simply rounds off to the nearest whole number.

@jbolorinos-ctr Can you confirm the fix and close?

jbolorinos-ctr closed this task as Resolved.Feb 27 2020, 9:25 PM

Hey Peter,

Thanks so much again for the quick fix.

Verified and closing this now as Resolved.