Commit 92d4a552 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fix: Bug 21535 - Некорректное округление числа при расчете функции FIXED

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50903 954022d7-b5bf-4e40-9824-e11837661b57
parent 23acfcab
...@@ -339,8 +339,7 @@ cFormulaFunction.TextAndData = { ...@@ -339,8 +339,7 @@ cFormulaFunction.TextAndData = {
if( num_digits > 0 ){ if( num_digits > 0 ){
cNull="."; cNull=".";
for ( var i = 0; i < num_digits; i++, cNull += "0" ) { for ( var i = 0; i < num_digits; i++, cNull += "0" ) {}
}
} }
this.value = new cString(oNumFormatCache.get("$#,##0"+cNull+";($#,##0"+cNull+")").format(roundHelper( number, num_digits ).getValue(), CellValueType.Number, gc_nMaxDigCount)[0].text) this.value = new cString(oNumFormatCache.get("$#,##0"+cNull+";($#,##0"+cNull+")").format(roundHelper( number, num_digits ).getValue(), CellValueType.Number, gc_nMaxDigCount)[0].text)
...@@ -635,7 +634,13 @@ cFormulaFunction.TextAndData = { ...@@ -635,7 +634,13 @@ cFormulaFunction.TextAndData = {
var number = arg0.getValue(), num_digits = arg1.getValue(); var number = arg0.getValue(), num_digits = arg1.getValue();
return this.value = new cString( toFix( roundHelper( number, num_digits ).toString(), arg2.toBool() ) ); var cNull = ""
if( num_digits > 0 ){
cNull=".";
for ( var i = 0; i < num_digits; i++, cNull += "0" ) {}
}
return this.value = new cString(oNumFormatCache.get("#"+(arg2.toBool()?"":",")+"##0"+cNull).format(roundHelper( number, num_digits ).getValue(), CellValueType.Number, gc_nMaxDigCount)[0].text)
} }
r.getInfo = function () { r.getInfo = function () {
return { return {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment