Skip to content

Commit

Permalink
Added formatNumber to refresh method
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhowell committed Jun 8, 2013
1 parent f094b14 commit 2dc51c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,11 @@ JustGage.prototype.refresh = function(val, max) {
obj.config.max = max;

obj.txtMaximum = obj.config.max;
if( obj.config.humanFriendly ) obj.txtMaximum = humanFriendlyNumber( obj.config.max, obj.config.humanFriendlyDecimal );
if( obj.config.humanFriendly ) {
obj.txtMaximum = humanFriendlyNumber( obj.config.max, obj.config.humanFriendlyDecimal );
} else if( obj.config.formatNumber ) {
obj.txtMaximum = formatNumber( obj.config.max );
}
obj.txtMax.attr({"text" : obj.txtMaximum});
setDy(obj.txtMax, obj.params.maxFontSize, obj.params.maxY);
}
Expand All @@ -726,6 +730,8 @@ JustGage.prototype.refresh = function(val, max) {
displayVal = obj.config.textRenderer(displayVal);
} else if( obj.config.humanFriendly ) {
displayVal = humanFriendlyNumber( displayVal, obj.config.humanFriendlyDecimal ) + obj.config.symbol;
} else if( obj.config.formatNumber ) {
displayVal = formatNumber((displayVal * 1).toFixed(obj.config.decimals)) + obj.config.symbol;
} else {
displayVal = (displayVal * 1).toFixed(obj.config.decimals) + obj.config.symbol;
}
Expand Down

0 comments on commit 2dc51c9

Please sign in to comment.