+ /**
+ * Test submitting a large float value is stored correctly in the db.
+ *
+ * @param string $thousandSeparator
+ * punctuation used to refer to thousands.
+ *
+ * @dataProvider getThousandSeparators
+ */
+ public function testLargeFloatOptionValue($thousandSeparator) {
+ $this->setCurrencySeparators($thousandSeparator);
+ $thousands = Civi::settings()->get('monetaryThousandSeparator');
+ $decimal = Civi::settings()->get('monetaryDecimalPoint');
+ $paramsSet['title'] = 'Price Set' . substr(sha1(rand()), 0, 7);
+ $paramsSet['name'] = CRM_Utils_String::titleToVar($paramsSet['title']);
+ $paramsSet['is_active'] = TRUE;
+ $paramsSet['financial_type_id'] = 'Event Fee';
+ $paramsSet['extends'] = 1;
+ $priceSet = $this->callAPISuccess('price_set', 'create', $paramsSet);
+ $form = new CRM_Price_Form_Field();
+ $form->_action = CRM_Core_Action::ADD;
+ $form->setPriceSetId($priceSet['id']);
+ $this->publicFieldParams['option_label'][1] = 'Large Float';
+ $this->publicFieldParams['option_amount'][1] = '123' . $thousands . '456' . $thousands . '789' . $decimal . '987654321';
+ $this->publicFieldParams['option_visibility_id'][1] = $this->visibilityOptionsKeys['public'];
+ $priceField = $form->submit($this->publicFieldParams);
+ $priceOptions = $this->callAPISuccess('PriceFieldValue', 'get', ['price_field_id' => $priceField->id]);
+ $this->assertEquals(123456789.987654321, $priceOptions['values'][$priceOptions['id']]['amount']);
+ }
+