Skip to content

Commit

Permalink
[se] Fix bug 54837
Browse files Browse the repository at this point in the history
  • Loading branch information
GoshaZotov committed Sep 29, 2023
1 parent 5c0a50b commit 9974ba0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions cell/model/FormulaObjects/engineeringFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,24 @@ function (window, undefined) {
var res = [];
var hasImag = this.img != 0, hasReal = !hasImag || (this.real != 0);

let toLocalString = function (val) {
let _res = val;
if (val != null) {
val = val.toString();
if (val) {
val = val.replace(AscCommon.FormulaSeparators.digitSeparatorDef, AscCommon.FormulaSeparators.digitSeparator);

if (val) {
_res = val;
}
}
}
return _res;
};

if (hasReal) {

res.push(this.real);
res.push(toLocalString(this.real));
}
if (hasImag) {
if (this.img == 1) {
Expand All @@ -540,7 +555,7 @@ function (window, undefined) {
} else if (this.img == -1) {
res.push("-");
} else {
this.img > 0 && hasReal ? res.push("+" + this.img) : res.push(this.img);
this.img > 0 && hasReal ? res.push("+" + (toLocalString(this.img))) : res.push(toLocalString(this.img));
}
res.push(this.suffix ? this.suffix : "i");
}
Expand Down

0 comments on commit 9974ba0

Please sign in to comment.