Skip to content

Commit

Permalink
update console log
Browse files Browse the repository at this point in the history
  • Loading branch information
g-viet committed Jun 14, 2019
1 parent c644922 commit 9f0c308
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export class Stock {
}

printf () {
console.log(`${this.code}\t${this.f(this.currentPrice)}\t\t${this.f(this.volume)}\t\t${this.f(this.openPrice)}\t\t${this.f(this.highestPrice)}\t\t${this.f(this.lowestPrice)}\t\t${this.time.toLocaleTimeString()}`);
const volume = this.f(this.volume);
console.log(`${this.code}\t${this.f(this.currentPrice)}\t\t${volume}${volume.length >= 9 ? '\t' : '\t\t' }${this.f(this.openPrice)}\t\t${this.f(this.highestPrice)}\t\t${this.f(this.lowestPrice)}\t\t${this.time.toLocaleTimeString()}`);
}

f(n: number) {
Expand Down

0 comments on commit 9f0c308

Please sign in to comment.