scurker/currency.js

Incorrect "format" function comments

Opened this issue · 2 comments

The comments on the currency.format function appear to refer to a previous signature of the function. The function accepts a options parameter, but the comment refers to a useSymbol parameter.

The comments should be updated to describe the shape of the options object and how to use it.

  /**
   * Formats the value as a string according to the formatting settings.
   * @param {boolean} useSymbol - format with currency symbol
   * @returns {string}
   */
  format(options) {
    let { _settings } = this;

    if(typeof options === 'function') {
      return options(this, _settings);
    }

    return _settings.format(this, Object.assign({}, _settings, options));
  },

Hey @scurker @chrisworman-pela can I contribute to this issue?

Yes, feel free to add a PR!