IssueRaiser

Support float values

Follow up from #486 We need to add support for floating point values that can be entered by user. Floating point values - numbers with dot i.e. `3.14` have following constraints: * Float values can be entered manually only in the code as a variable or object value * They cannot be a parameter * They cannot be an output of an function * They are not allowed as part of expressions * There's `float()` function that should be supported - it can be used only in variables and as object values Valid usage in ARM: ``` { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "inPi": { "type": "string", "defaultValue": "3.14" } }, "functions": [], "variables": { "pi": 3.14, "objectPi": { "pi": 3.14 }, "pi2": "[float('3.14')]", "pi3": "[float(variables('pi'))]", "pi4": "[float(parameters('inPi'))]" }, "resources": [], "outputs": { "out0": { "type": "object", "value": "[createObject('pi', variables('pi'))]" }, "out1": { "type": "object", "value": "[variables('objectPi')]" }, "out2": { "type": "object", "value": "[createObject('pi2',variables('pi2'))]" }, "out3": { "type": "object", "value": "[createObject('pi3',variables('pi3'))]" }, "out4": { "type": "object", "value": "[createObject('pi4',variables('pi4'))]" } } } ```

Posted by miqm on Jan 26, 2021, 7:25 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

support (Other)

Support float values

miqmJan 26, 2021, 7:25 PM

Follow up from #486 We need to add support for floating point values that can be entered by user. Floating point values - numbers with dot i.e. `3.14` have following constraints: * Float values can be entered manually only in the code as a variable or object value * They cannot be a parameter * They cannot be an output of an function * They are not allowed as part of expressions * There's `float()` function that should be supported - it can be used only in variables and as object values Valid usage in ARM: ``` { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "inPi": { "type": "string", "defaultValue": "3.14" } }, "functions": [], "variables": { "pi": 3.14, "objectPi": { "pi": 3.14 }, "pi2": "[float('3.14')]", "pi3": "[float(variables('pi'))]", "pi4": "[float(parameters('inPi'))]" }, "resources": [], "outputs": { "out0": { "type": "object", "value": "[createObject('pi', variables('pi'))]" }, "out1": { "type": "object", "value": "[variables('objectPi')]" }, "out2": { "type": "object", "value": "[createObject('pi2',variables('pi2'))]" }, "out3": { "type": "object", "value": "[createObject('pi3',variables('pi3'))]" }, "out4": { "type": "object", "value": "[createObject('pi4',variables('pi4'))]" } } } ```

Comments (0)

No comments yet. Start the discussion.

Comment on this issue