JS: Add Currency.json_rewrite().

This commit is contained in:
Arthur Britto
2012-10-31 16:42:22 -07:00
committed by Stefan Thomas
parent 1db7da9f63
commit 1a1f4db2c2

View File

@@ -232,6 +232,11 @@ var Currency = function () {
this.value = NaN; this.value = NaN;
} }
// Given "USD" return the json.
Currency.json_rewrite = function(j) {
return Currency.from_json(j).to_json();
};
Currency.from_json = function (j) { Currency.from_json = function (j) {
return (new Currency()).parse_json(j); return (new Currency()).parse_json(j);
}; };