Permalink
Browse files

Fix whitespace

  • Loading branch information...
1 parent d56de60 commit 1ec8ad72cd70fe8c918d340e4e390540458accf3 @domharrington committed Feb 6, 2014
Showing with 25 additions and 24 deletions.
  1. +25 −24 index.js
View
@@ -1,35 +1,36 @@
(function(root){
- 'use strict';
+ 'use strict';
- var numberAbbreviate = function(number, decPlaces) {
- decPlaces = Math.pow(10, decPlaces)
+ function numberAbbreviate(number, decPlaces) {
+ decPlaces = Math.pow(10, decPlaces)
- var abbrev = [ 'k', 'm', 'b', 't' ]
+ var abbrev = [ 'k', 'm', 'b', 't' ]
- for (var i = abbrev.length - 1; i>=0; i--) {
+ for (var i = abbrev.length - 1; i>=0; i--) {
- var size = Math.pow(10, (i + 1) * 3)
+ var size = Math.pow(10, (i + 1) * 3)
- if(size <= number) {
- number = Math.round(number * decPlaces / size) / decPlaces
+ if (size <= number) {
+ number = Math.round(number * decPlaces / size) / decPlaces
- if((number === 1000) && (i < abbrev.length - 1)) {
- number = 1
- i++
- }
+ if ((number === 1000) && (i < abbrev.length - 1)) {
+ number = 1
+ i++
+ }
- number += abbrev[i]
+ number += abbrev[i]
- break
- }
- }
-
- return number
- };
-
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = numberAbbreviate;
- } else {
- root.numberAbbreviate = numberAbbreviate;
+ break
+ }
}
+
+ return number
+ }
+
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = numberAbbreviate;
+ } else {
+ root.numberAbbreviate = numberAbbreviate;
+ }
+
})(this);

0 comments on commit 1ec8ad7

Please sign in to comment.