I want to Format text coming from a sum of two other inputs in currency format.
- I can either have nice formatting 000,000,000 and not show a 0 if the text being formatted is 0
- OR I can show a 0 but I loose the number formatting
Text(Sum(Value(txtInput1.Text),Value(txtInput2.Text), "[$-en-US]###,###,###")) = shows 0 but no formatting
Text(Text(Sum(Value(txtInput1.Text),Value(txtInput2.Text)), "[$-en-US]###,###,###")) = shows formatting but if 0 it shows blank
Any options here to use formatting if numbers input and of sum = 0 still show 0??
- I tried and If statement to detect if sum = 0 just return 0 not through format string, but formatting doesn't like to be in a if statement either
Solved! Go to Solution.
If(IsBlank(TextInput1)&&IsBlank(TextInput2),"0",Text(Sum(Value(TextInput1.Text),Value(TextInput2.Text)),"###,###,###"))
Hi @RickJ ,
You could create 2 lables to show value.
If the value is 0, label1 is displayed.
If the value is not 0, label2 is displayed
For example:
Label1 Visible:
If(Sum(Value(TextInput1.Text),Value(TextInput2.Text),"[$-en-US] ###,###,###")=0,true,false)
Label1 Text:
0
Label2 Visible:
If(Sum(Value(TextInput1.Text),Value(TextInput2.Text),"[$-en-US] ###,###,###")<>0,true,false)
Label2 Text:
Text(Sum(Value(TextInput1.Text),Value(TextInput2.Text)),"[$-en-US] ###,###,###")
Finally, overlap the positions of these two controls.
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hi @RickJ ,
I think the below should work:
Text(Sum(Value(TextInput1.Text),Value(TextInput2.Text)), If(Sum(Value(TextInput1.Text),Value(TextInput2.Text)) = 0,"0","[$-en-US]###,###,###"))
So do the if statement around the format string instead of the value.
Thanks,
Liam
If(IsBlank(TextInput1)&&IsBlank(TextInput2),"0",Text(Sum(Value(TextInput1.Text),Value(TextInput2.Text)),"###,###,###"))
Thanks great solutions, and I just added in the handle for 0 as well as blanks and it works great.
If(
(IsBlank(TextInput1)||TextInput1.Text="0")&&(IsBlank(TextInput2)||TextInput2.Text="0"),
"0",
Text(Sum(Value(TextInput1.Text),Value(TextInput2.Text)),"###,###,###")
)
Thanks, your solution also worked, I tried to add in for it to be able to handle 0 input along side blanks but couldn't get it working. Thanks again for replying
User | Count |
---|---|
122 | |
86 | |
83 | |
74 | |
69 |
User | Count |
---|---|
215 | |
179 | |
141 | |
108 | |
83 |