Provide example in JavaScript (#15286)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2023-07-22 22:37:48 +02:00 committed by GitHub
parent a6cbf37b75
commit 0fe144708c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,11 +15,28 @@ Number CurrentSpotPrice "Current Spot Price incl. VAT [VAT(12.5):%s]" <price>
Add Danish VAT to price:
```java
:::: tabs
::: tab DSL
```javascript
var Number price = 499
logInfo("Price", "Price incl. VAT: " + transform("VAT", "DK", price.toString))
```
:::
::: tab JavaScript
```javascript
var price = 499;
console.log("Price incl. VAT: " + actions.Transformation.transform("VAT", "DK", price.toString()));
```
:::
::::
## Usage as a Profile
The functionality of this `TransformationService` can also be used in a `Profile` on an `ItemChannelLink`.