code: function checkCurrencyFormat(format) {
    var defaults = currency.format;
  
    // Allow function as format parameter (should return string or object):
    if ( typeof format === "function" ) {
      format = format();
    }
  
    // Format can be a string, in which case `value` ("%v") must be present:
    if ( typeof format === "string" && format.match("%v") ) {
  
      // Create and return positive, negative and zero formats:
      return {
        pos : format,
        neg : format.replace("-", "").replace("%v", "-%v"),
        zero : format
      };
  
    // If no format, or object is missing valid positive value, use defaults:
    } else if ( !format || !format.pos || !format.pos.match("%v") ) {
  
      // If defaults is a string, casts it to an object for faster checking next time:
      if (typeof defaults !== "string") {
        return defaults;
      } else {
        return currency.format = {
          pos : defaults,
          neg : defaults.replace("%v", "-%v"),
          zero : defaults
        };
      }
    }
    // Otherwise, assume format was fine:
    return format;
  }
docs: Parses a format string or object and returns format obj for use in rendering
  
  `format` is either a string with the default (positive) format, or object
  containing `pos` (required), `neg` and `zero` values (or a function returning
  either a string or object)
  
  Either string or format.pos must contain "%v" (value) to be valid