Skip to content

Commit

Permalink
Merge pull request #1151 from hajkmap/feature/1150-Infoclick-multiplyBy
Browse files Browse the repository at this point in the history
Feature/1150 infoclick multiply by
  • Loading branch information
jesade-vbg authored Sep 1, 2022
2 parents 09d36a7 + f40c42e commit 84c9d4c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions new-client/src/components/FeatureInfo/FeaturePropsFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,19 @@ filters.add("formatNumber", function (value) {
return Number(value).toLocaleString();
});

/*
multiplyBy
Example:
{'0.08'|multiplyBy(100)}
outputs: 8
*/
filters.add("multiplyBy", function (value, multiplier) {
if (isNaN(value) || isNaN(multiplier)) {
throw new Error("Arguments should be numbers");
}
return value * multiplier;
});

/*
toUpper
Example:
Expand Down

0 comments on commit 84c9d4c

Please sign in to comment.