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.

image.png (849×1 px, 263 KB)

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

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

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?

Hey Peter,

Thanks so much again for the quick fix.

image.png (682×1 px, 187 KB)

Verified and closing this now as Resolved.