This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* parseCSV | |
* Light weight CSV paser function that works in old versions of JavaScript | |
* @version 1.0.0 | |
* @author McShaman | |
* @licence MIT | |
*/ | |
(function(window) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function letterToNumber( str ) { | |
var string = str.toUpperCase(), | |
length = string.length, | |
value, | |
number = 0; | |
// Validate string | |
if( ! string.match( /^[A-Z]+$/ ) ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function romanToNumber( str ) { | |
var string = str.toUpperCase(), | |
letters = string.split( '' ), | |
length = letters.length, | |
i, | |
mapping = { I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000 }, | |
values = [], | |
valueA, | |
valueB, |