Hello:
I am using 3.5.2 base with Joomla plug-in and encountered an issue where a tag reference in this format:
[myblock.myfield;fmt='$ 0,000.00']
|
In my example, I was passing the value 123.45 into myblock.myfield
Was not working. I tried a variety of formats and re-read docs but finally started to debug the class to see where I was going wrong. I found the numeric formatter in tinybutstrong_class_php5.php and specifically, the function meth_Misc_Format.
upon debugging, I think that there may be an error in the code around line 5765 in the case 'num' logic (code below compressed):
case 'num' :
// NUMERIC
if ($CheckNumeric) {
if (is_numeric($Value)) {
if (is_string($Value)) $Value = 0.0 + $Value;
} else {
|
It appears that the instruction on the 4th line of the above snippett (if (is_numeric($Value)) { is evaluating to boolean FALSE.
To remedy, I modified this code as:
case 'num' :
// NUMERIC
$Value = (string)$Value;// <--- my added instruction to cast $Value as a string
if ($CheckNumeric) {
if (is_numeric($Value)) {
if (is_string($Value)) $Value = 0.0 + $Value;
} else {
|
With this modification, the passed valued of 123.45 does apply the conversion as (I) expected.
Perhaps there is a more proper fix and perhaps my fix will introduce other errors but I wanted to pass this along in case anyone else is experiencing issues with decimal values and the frm param.
Last point. I downloaded and checked the source for the latest joomla plug-in which is based on tbs 3.7 and this section of code appears to be unchanged from the version I made. However, due to time constraints, I didn't have time to setup a test site to try-out the new version of the Joomla plug-in to see if it contains another (better) fix that resolves this issue. I will try to get to that test in the coming weeks unless someone replies here indicating that I have, indeed, uncovered a bug.