In this post, We will learn what is value function in PowerApps, and how to convert text to number using PowerApps Value function .
PowerApps value function
- The Power apps Value function returns a number value from a string of text that contains number characters.
- You can use Power apps Value function when you need to perform calculations on numbers entered as text by a user.
- By default the text is interpreted in the current user’s language . You can use the same language tags that the Language function returns to specify the language to use with a language tag.
Value function syntax
Value( String [, LanguageTag ] )
Where String is String to convert to a numeric value.
and LanguageTag – Optional. The language tag in which to parse the string. If not specified, the language of the current user is used.
You need to remember the following points while working with the Value functions in PowerApps:
- The string may be prefixed with the currency symbol for the current language. The currency symbol is ignored. Currency symbols for other languages are not ignored.
- The string may be include a percent sign (%) at the end, indicating that it is a percentage. The number will be divided by 100 before being returned. Percentages and currency symbols cannot be mixed.
- The string may be in scientific notation, with 12 x 103 expressed as “12e3”.
PowerApps Value function Examples
Example1:
Value( "113.512" )
The result here will be 113.512 as the default language of the user is “en-US”
Example2:
Value( "113.512" ,"es-ES")
The result here will be 113512 as the language is “es-ES”, so a period is a thousands separator in Spain.
Example3
Value( "113,512" ,"es-ES")
In Spain a comma is the decimal separator, so the result will be 113.512
Example 4:
Value( "113,512" )
The default language of “en-US” will be used, which uses a comma as a thousands separator, so the result will be 113521
Example 5:
Value( “98.19%” )
the value is a percentage so the value represents a percentage symbol at the end of the string, so it is a percentage and the result will be .9819
Example 6:
Value( “$ 90.15” )
The currency symbol for the current language is ignored so the result will be 90.15 and we have take in consideration the current value that is en-US the default one . as in some language like Spain the “.” is for thousand separator so the result will differ.
Use the Value function to convert the text input to number, the formula will be
Value(yourtextinput.Text)
You can use the result of the PowerApps value function for your calculation or you can use the result of PowerApps value function as variable.
set(var1,Value(yourstring))
In conclusion the PowerApps value function used to convert string to number.
See Also
- Nested Collection In PowerApps :3 Level
- Tabbed Form In PowerApps
- PowerApps Variables Types : Context Variable Vs Global Variable Vs Collections
- Canvas App Collections
- How To Overcome PowerApps Delegation Limit?
- How To Use Power Automate?
- PowerApps Print Function, Forms, And Scrollable Galleries
- PowerApps Validation Examples On/before Submitting
- Share PowerApps With External Users / Guest Users
Join us
- Subscribe to Power Platform Geeks YouTube channel.
- Register to Saudi Arabia Power Platform User Group.
Need Help
- Have a related question? Please ask it at deBUG.to Community.