Content-Length: 225042 | pFad | http://github.com/jonschlinkert/romanize/commit/2d7680ea3cac4f5fca611b9efaaa7d6d551a1e9f

39 minor formatting · jonschlinkert/romanize@2d7680e · GitHub
Skip to content

Commit

Permalink
minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Jan 25, 2016
1 parent 12627f3 commit 2d7680e
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,28 @@
'use strict';

module.exports = function(num) {
var lookup = {M: 1000, CM: 900, D: 500, CD: 400, C: 100, XC: 90, L: 50, XL: 40, X: 10, IX: 9, V: 5, IV: 4, I: 1};
var numeral = '';
var lookup = {
M: 1000,
CM: 900,
D: 500,
CD: 400,
C: 100,
XC: 90,
L: 50,
XL: 40,
X: 10,
IX: 9,
V: 5,
IV: 4,
I: 1
};

for (var i in lookup) {
while (num >= lookup[i]) {
numeral += i;
num -= lookup[i];
for (var key in lookup) {
while (num >= lookup[key]) {
numeral += key;
num -= lookup[key];
}
}
return numeral;
};
};

0 comments on commit 2d7680e

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/jonschlinkert/romanize/commit/2d7680ea3cac4f5fca611b9efaaa7d6d551a1e9f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy