Skip to content

Incompatible api with accounting.js #8

@teameh

Description

@teameh

Same as original accounting.js, but ..

Not 100%, The settings api is different.

The docs here say you could set this different defaults in accounting.settings.currency if you like. This is a bit confusing as the api for setting these defaults in this package is different.

Accounting.js:

accounting.settings = {
    currency: {
        symbol : "$",   // default currency symbol is '$'
        format: "%s%v", // controls output: %s = symbol, %v = value/number (can be object: see below)
        decimal : ".",  // decimal point separator
        thousand: ",",  // thousands separator
        precision : 2   // decimal places
    },
    number: {
        precision : 0,  // default precision on numbers is 0
        thousand: ",",
        decimal : "."
    }
}

vs this package:

accounting.settings = {
  symbol: '$',        // default currency symbol is '$'
  format: '%s%v',     // controls output: %s = symbol, %v = value (can be object, see docs)
  decimal: '.',       // decimal point separator
  thousand: ',',      // thousands separator
  precision: 2,       // decimal places
  grouping: 3,        // digit grouping (not implemented yet)
  stripZeros: false,  // strip insignificant zeros from decimal part
  fallback: 0         // value returned on unformat() failure
};

I've also found that setting the whole settings object at once does not work.. see #7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions