Power Apps – Split Decimal and Whole Number

5 steps

Introduction:

We will make a set up showing how to split the decimal and whole number values from a number in 2 ways:

Round/Down & Mod combination

RoundDown(YourNumber,0)
Mod(YourNumber,1)

Split Combination

First(Split(Text(YourNumber),".")).Value
Last(Split(Text(YourNumber),".")).Value

Step 1:

Insert a Text Input named TextInput1. Change its properties to the following:

Default property

""

Step 2:

Insert a label named Label1 below TextInput1. Change the following properties:

Text property

RoundDown(Value(TextInput1.Text),0)

Step 3:

Insert a label named Label2 beside Label1. Change the following properties:

Text property

Mod(Value(TextInput1.Text),1)

Step 4:

Insert a label named Label3 below Label1. Change the following properties:

Text property

First(Split(TextInput1.Text,".")).Value

Step 5:

Insert a label named Label4 below Label2. Change the following properties:

Text property

Last(Split(TextInput1.Text,".")).Value

Conclusion:

To test it out, put any number with decimal values on TextInput1. The top labels (Label1 and Label2) will give you the whole number and the decimal with the leading zero and decimal point. The bottom labels (Label3 and Label4) will give you the whole number and the decimal values without the decimal point.


Article last updated on Feb 9, 2024

 

Need expert guidance on Power Apps?