Code Duplication    Length = 10-10 lines in 2 locations

class/smartobject.php 1 location

@@ 1036-1045 (lines=10) @@
1033
            case XOBJ_DTYPE_CURRENCY:
1034
                $decimal_section_original = strstr($ret, '.');
1035
                $decimal_section          = $decimal_section_original;
1036
                if ($decimal_section) {
1037
                    if (strlen($decimal_section) == 1) {
1038
                        $decimal_section = '.00';
1039
                    } elseif (strlen($decimal_section) == 2) {
1040
                        $decimal_section .= '0';
1041
                    }
1042
                    $ret = str_replace($decimal_section_original, $decimal_section, $ret);
1043
                } else {
1044
                    $ret .= '.00';
1045
                }
1046
                break;
1047
1048
            case XOBJ_DTYPE_TXTAREA:

include/functions.php 1 location

@@ 1279-1288 (lines=10) @@
1276
    // make sur we have at least .00 in the $var
1277
    $decimal_section_original = strstr($ret, '.');
1278
    $decimal_section          = $decimal_section_original;
1279
    if ($decimal_section) {
1280
        if (strlen($decimal_section) == 1) {
1281
            $decimal_section = '.00';
1282
        } elseif (strlen($decimal_section) == 2) {
1283
            $decimal_section .= '0';
1284
        }
1285
        $ret = str_replace($decimal_section_original, $decimal_section, $ret);
1286
    } else {
1287
        $ret .= '.00';
1288
    }
1289
    if ($currencyObj) {
1290
        $ret = $ret . ' ' . $currencyObj->getCode();
1291
    }