]> git.basschouten.com Git - openhab-addons.git/commitdiff
Provide example in JavaScript (#15286)
authorJacob Laursen <jacob-github@vindvejr.dk>
Sat, 22 Jul 2023 20:37:48 +0000 (22:37 +0200)
committerGitHub <noreply@github.com>
Sat, 22 Jul 2023 20:37:48 +0000 (22:37 +0200)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
bundles/org.openhab.transform.vat/README.md

index a39046905d34031bf6d7ec20847d6c69fa62442f..00ac4c7899a8c5dd2ae308291bd6d4b05e5a3fad 100644 (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`.