Givewp: Donation Goal amount is reduced when thousands separator is set to a period

Created on 11 Aug 2017  路  6Comments  路  Source: impress-org/givewp

Issue Overview

Setting the thousands separator to a period still seems to be problematic for our users in various ways. IN this case, when the thousands separator is a period and the decimal separator is a comma, the goal doesn't save correctly.

Expected Behavior

The amount should never change upon save.

Current Behavior

The goal amount changes after saving the form when the thousands separator is set to a period.

Steps to Reproduce (for bugs)

  1. Set the thousands separator to a period. Optionally also set the decimal separator to a comma.
  2. Create a form with a goal that is 1,000 then save the form
  3. Upon refresh, check the goal and it will now be 1.

Also, when XDebug is on, you should see this PHP warning as well:
Notice: A non well formed numeric value encountered in ...\wp-content\plugins\give\includes\formatting.php on line 113

Related Issues and/or PRs

https://github.com/WordImpress/Give/issues/1981

Todos

  • [ ] Confirm this fix for the goal amount.
  • [ ] Confirm on #1981 as well (the multi-level amounts)
  • [ ] Confirm the fix works for the "Set Donation Amount" field
  • [ ] Confirm the fix works for the "Minimum Amount" field

Most helpful comment

Just tested this, looks really solid guys. Great work!

All 6 comments

Reopening since @mehul0810 found a bug:

This happens when currency is setup like so:

2017-09-07_13-36-02

@DevinWalker
Found Another bug
please see the video http://screencast-o-matic.com/watch/cbQirwIQHv

Another Bug in the dashboard page of All Forms
Step to reproduce the issues
Step 1-> Add Some form and donation to it
Step 2 -> Change thousand separate to anything you like
Step 3 -> Now view the All form page

Places where you will find the same
1> All Forms
2> Form single page

image

@DevinWalker

When setting Thousands Separator as empty it adding a space with the Amount
image

Is this an issue?

Another Bug in the dashboard page of All Forms
-> Working Fine ( No need to do anything to it )

When setting Thousands Separator as empty it adding a space with the Amount
->we support space as thousand separator as some number system have that

Just tested this, looks really solid guys. Great work!

Was this page helpful?
0 / 5 - 0 ratings