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
IO.read("testfile") # reads testfile in as a string | |
IO.readlines("testfile") # reads testfile in as an array |
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
IO.read("testfile") # reads testfile in as a string | |
IO.readlines("testfile") # reads testfile in as an array |
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
String.prototype.reverse = function() { | |
return this.split("").reverse().join(""); | |
} | |
Number.prototype.formatAsCurrency = function() { | |
return this.toString() | |
.replace(/^(\d)$/, "00$1") // pad 1 digit | |
.replace(/^(\d{2})$/, "0$1") // pad 2 digits | |
.reverse() | |
.replace(/(\d{2}(?=\d))/, "$1.") // place decimal point |
NewerOlder