From ba66359995e5dbd23fef4ed2f53ddbf2a30aa84e Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 8 Jul 2013 21:43:42 +0400 Subject: [PATCH] Fixed bug that CJavaScript::encode was formatting floats in a wrong way during encoding --- CHANGELOG | 1 + framework/web/helpers/CJavaScript.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index d5fb54c5e..552c7331d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ Version 1.1.14 work in progress ------------------------------- - Bug: There was unnecessary echo in CRUD views generated by Gii (samdark) +- Bug: CJavaScript::encode was formatting floats in a wrong way during encoding (samdark) - Bug #101: CActiveFinder::buildJoinTree() no longer uses 'false' for 'select' value (klimov-paul) - Bug #135: Fixed wrong CActiveRecord rows count with having (klimov-paul) - Bug #139: Fixed Active Record lazy load through relation with condition (klimov-paul) diff --git a/framework/web/helpers/CJavaScript.php b/framework/web/helpers/CJavaScript.php index a2ec154d2..9cebcf2e4 100644 --- a/framework/web/helpers/CJavaScript.php +++ b/framework/web/helpers/CJavaScript.php @@ -78,7 +78,7 @@ class CJavaScript elseif($value===INF) return 'Number.POSITIVE_INFINITY'; else - return rtrim(sprintf('%.16F',$value),'0'); // locale-independent representation + return str_replace(',','.',(float)$var); // locale-independent representation } elseif($value instanceof CJavaScriptExpression) return $value->__toString();