Skip to content

Commit

Permalink
Fixed currency support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Globegitter committed Mar 15, 2015
1 parent 51abdb1 commit e0b1ec3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chartist-plugin-tooltip",
"version": "0.0.5",
"version": "0.0.6",
"main": [
"./dist/chartist-plugin-tooltip.min.js"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/chartist-plugin-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

var value = $point.attr('ct:value');
if (options.currency) {
value = options.currency + value.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
value = options.currency + value.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,");
}
tooltipText += value;

Expand Down
4 changes: 2 additions & 2 deletions dist/chartist-plugin-tooltip.min.js

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

2 changes: 1 addition & 1 deletion dist/chartist-plugin-tooltip.min.js.map

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,7 +1,7 @@
{
"name": "chartist-plugin-tooltip",
"description": "Point Labels Plugin for Chartist.js",
"version": "0.0.5",
"version": "0.0.6",
"author": "Markus Padourek",
"homepage": "https://github.com/Globegitter/chartist-plugin-tooltip",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/chartist-plugin-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

var value = $point.attr('ct:value');
if (options.currency) {
value = options.currency + value.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
value = options.currency + value.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,");
}
tooltipText += value;

Expand Down

0 comments on commit e0b1ec3

Please sign in to comment.