View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0005036 | OXID eShop (all versions) | 1.03. Basket, checkout process | public | 2013-04-03 14:57 | 2013-04-11 13:07 | 
| Reporter | mark | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always | 
| Status | resolved | Resolution | fixed | ||
| Product Version | 4.7.4 / 5.0.4 revision 57063 | ||||
| Fixed in Version | 4.7.5 / 5.0.5 | ||||
| Summary | 0005036: smarty_modifier_oxnumberformat does not work with given precision | ||||
| Description | http/core/smarty/plugins/modifier.oxnumberformat.php Line 41 is $oCur->decimal = 0;//trim($sCur[5]); This disables the precision given in the first parameter of the function | ||||
| Steps To Reproduce | Call function with [{"EUR@ 1.00@ ,@ .@ €@ 2"|oxnumberformat:59.95}] from template. Then change smarty plugin line 41 to $oCur->decimal = trim($sCur[5]); Now function works as intended | ||||
| Tags | No tags attached. | ||||
| Theme | Both | ||||
| Browser | All | ||||
| PHP Version | any | ||||
| Database Version | any | ||||
|  | You could also add if ($sFormat === "") { $oCur = null; } else { // logic copied from oxconfig::getCurrencyArray() $sCur = explode( "@", $sFormat); $oCur = new stdClass(); $oCur->id = 0; $oCur->name = @trim($sCur[0]); $oCur->rate = @trim($sCur[1]); $oCur->dec = @trim($sCur[2]); $oCur->thousand = @trim($sCur[3]); $oCur->sign = @trim($sCur[4]); $oCur->decimal = @trim($sCur[5]); // change for US version if (isset($sCur[6])) { $oCur->side = @trim($sCur[6]); } } So that if you call the plugin with ""|oxnumberformat:$dValue OXID automatically chooses the right format | 
|  | Fixed as proposed in the comments. | 
