BUG-14288 Evaluation not working properly with currency field SOLVED
- the field no float format. - add function PMRemoveMask in file class.pmFunctions.php that erase the mask.
This commit is contained in:
@@ -2837,3 +2837,29 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i
|
||||
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
/**
|
||||
*@method
|
||||
*
|
||||
* It delete the mask a field.
|
||||
*
|
||||
* @name PMFAddAttachmentToArray
|
||||
*
|
||||
* @param string | $field | Value the field
|
||||
* @param string | $separator | Separator of thousands (, or .)
|
||||
* @param string | $currency | symbol of currency
|
||||
* @return $field | value without mask
|
||||
*
|
||||
*/
|
||||
|
||||
function PMRemoveMask ($field, $separator = '.', $currency = '')
|
||||
{
|
||||
$sep = array();
|
||||
if ( trim($currency) != '') {
|
||||
$sep[] = $currency;
|
||||
}
|
||||
$sep[] = ($separator == ',') ? '.' : ',';
|
||||
$field = str_replace($sep, '', $field);
|
||||
$field = trim(str_replace($separator, '.', $field));
|
||||
return $field;
|
||||
}
|
||||
Reference in New Issue
Block a user