Skip to content

Commit

Permalink
#251 datalabel decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-taeho committed Sep 17, 2018
1 parent ee19aa8 commit 7cf3ab4
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,17 @@ export class FormatOptionConverter {
// Add decimal zero
if (value && format.type != String(UIFormatType.EXPONENT10) && format.decimal > 0) {
let stringValue: string = String(value);
console.info("변경전: "+ value);
if( stringValue.indexOf(".") == -1 ) {
value += ".";
for( let num: number = 0 ; num < format.decimal ; num++ ) {
value += "0";
}
}
else {
value = stringValue.split(".")[0];
value += ".";
for( let num: number = 0 ; num < format.decimal ; num++ ) {
for( let num: number = stringValue.split(".")[1].length ; num < format.decimal ; num++ ) {
value += "0";
}
}
console.info("변경후: "+ value);
}

// 통화
Expand Down

0 comments on commit 7cf3ab4

Please sign in to comment.