/    /  Amazon QuickSight – intToDecimal

Amazon QuickSight – intToDecimal

 

In Amazon QuickSight, the intToDecimal function is used to convert an integer to a decimal number. The resulting decimal number will have zero decimal places, representing it as a whole number. 

Syntax

#Start#
intToDecimal(integer)
#End#

 

This function takes one argument

  1. integer: A field that uses the integer data type, a literal value like 14, or a call to another function that outputs an integer.

Example

#Start#
intToDecimal({Quantity})
#End#

 

This expression will convert the integer value in the Quantity field to a decimal number without any decimal places. For example, if the value of Quantity is 10, the result of this expression will be 10.0.

 

You can use the result of this expression in further calculations or display it in visualizations as a decimal number. Note that if you need to perform calculations that involve decimal places, you may need to use the toString function to convert the result of intToDecimal back to a string and then use a function like toFixed to specify the number of decimal places you want to display.