Skip to content

Commit

Permalink
Fixed #55
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Litzenburger committed Jul 15, 2023
1 parent 3f418b4 commit 0295f2c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions MMM-Jast.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmm-jast",
"version": "2.8.1",
"version": "2.8.2",
"description": "A minimalistic stock ticker based on Yahoo's finance API for the MagicMirror² platform.",
"main": "MMM-Jast.js",
"repository": {
Expand Down
8 changes: 6 additions & 2 deletions src/frontend/JastFrontendUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type CurrencyStyle = {
currency?: string
currencyDisplay: string
minimumFractionDigits: number
maximumFractionDigits: number
}

type PercentStyle = {
Expand All @@ -23,7 +24,8 @@ export default class JastUtils {
style: config.showCurrency ? 'currency' : 'decimal',
useGrouping: config.useGrouping,
currencyDisplay: config.currencyStyle,
minimumFractionDigits: config.numberDecimalsValues <= 8 ? config.numberDecimalsValues : 8
minimumFractionDigits: config.numberDecimalsValues <= 8 ? config.numberDecimalsValues : 8,
maximumFractionDigits: config.numberDecimalsValues <= 8 ? config.numberDecimalsValues : 8
}
}

Expand All @@ -32,7 +34,8 @@ export default class JastUtils {
style: config.showChangeValueCurrency ? 'currency' : 'decimal',
useGrouping: config.useGrouping,
currencyDisplay: config.currencyStyle,
minimumFractionDigits: config.numberDecimalsValues <= 8 ? config.numberDecimalsValues : 8
minimumFractionDigits: config.numberDecimalsValues <= 8 ? config.numberDecimalsValues : 8,
maximumFractionDigits: config.numberDecimalsValues <= 8 ? config.numberDecimalsValues : 8
}
}

Expand Down Expand Up @@ -61,6 +64,7 @@ export default class JastUtils {
}

static getStockChangeAsString(stock: StockResponse, config: Config): string {
console.log("Style", JastUtils.getChangeValueStyle(config))
return JastUtils.getStockChange(stock).toLocaleString(
config.locale,
Object.assign(JastUtils.getChangeValueStyle(config), {
Expand Down

0 comments on commit 0295f2c

Please sign in to comment.