From 82f4224788f48a06d33c3a138a8011072ee2ab59 Mon Sep 17 00:00:00 2001 From: DBoland63 Date: Wed, 12 Apr 2017 11:45:31 +0100 Subject: [PATCH 1/2] changed & to & on line 359 changed & to & on line 359 to conform to web standards --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 49aa9d7..b12e02d 100644 --- a/index.html +++ b/index.html @@ -356,7 +356,7 @@

Links

accounting.js is maintained by Open Exchange Rates - the lightweight currency data API for startups, SMEs and Fortune 500s.

Feedback, support or questions? Contact Open Exchange Rates for guidance.

Bugs, issues, suggestions or contributions? Please post them here.

-

accounting.js works great with money.js - the tiny (1kb) standalone JavaScript currency conversion library, for web & nodeJS

+

accounting.js works great with money.js - the tiny (1kb) standalone JavaScript currency conversion library, for web & nodeJS



From 17690a429af283e5a76d4822a2707659d2db6952 Mon Sep 17 00:00:00 2001 From: DBoland63 Date: Tue, 16 May 2017 10:19:07 +0100 Subject: [PATCH 2/2] changed some notes changed some notes and commented out social buttons --- accounting.js | 26 +++++++++++++++++++------- index.html | 4 ++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/accounting.js b/accounting.js index fd181fd..9fdad96 100644 --- a/accounting.js +++ b/accounting.js @@ -124,13 +124,25 @@ /** * 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 - */ + * Parameters: + * string has "default positive format, must contain "%v" + * object has 'pos' (required, must contain "%v"), 'neg', 'zero' properties + * function returns a string or object like above + * + * Returns: + * Object has 'pos' (required, must contain "%v"), 'neg', 'zero' properties + * + */ + // Scenarios: + // A: Valid string ==> convert string to a format object + // B: Invalid string ==> use default and turn it into an object, if it's not already + // C: Valid object ==> leave the object alone + // D: Invalid object ==> use default and turn it into an object, if it's not already + // E: Function ==> Depends on waht the function returns + // F: Nothing ==> use default and turn it into an object, if it's not already + function checkCurrencyFormat(format) { + //The default value will be "%s%v" to start. var defaults = lib.settings.currency.format; // Allow function as format parameter (should return string or object): @@ -169,7 +181,7 @@ * Alias: `accounting.parse(string)` * * Decimal must be included in the regular expression to match floats (defaults to - * accounting.settings.number.decimal), so if the number uses a non-standard decimal + * accounting.settings.number.decimal), so if the number uses a non-standard decimal * separator, provide it as the second argument. * * Also matches bracketed negatives (eg. "$ (1.99)" => -1.99) diff --git a/index.html b/index.html index b12e02d..3b9cbea 100644 --- a/index.html +++ b/index.html @@ -26,7 +26,7 @@

accounting.js

It's lightweight, has no dependencies and is suitable for all client-side and server-side JavaScript applications.

-

 

+