Set decimal points in all textboxes

Hi - I have a project where all text boxes are numeric only and I want to set them to only display 2 decimal places.

I have tried using batch handling of all text boxes as per the image attached but get the error message "Bad List Argument Foreach - The second argument to foreach is not a list . The second argument is nothing"

Clearly the problem is in the second "getItem" block but I don't know what else to use. Please help.

Insert the generic get TextBox.Text block here:

You also have to rename the global variable SetDecimal2 to SetDecimal.

Thanks gordonlu - I have searched for the last hour but can't find the generic "get TextBox".Text block. Where is it hidden?

I have tried all the block menus and Googling without luck.

In your blocks editor, scroll down to the bottom of the palette on the left (or hide all open sections there)

image

You will find the every.TextBox block in there too

Try this one


Taifun

Thanks Tim & Taifun - I did use one of those in my original post but I can't find the block to slot into the "Of Component" gap as recommended by Gordon with the red arrow.
"Every Textbox" won't slot in...
.

The component in your case is the item
What about providing a screenshot of your updated blocks?

Taifun

Possibly like this:

Ensure all your textboxes have a default value of at least 0 (or any number)

1 Like

Thank you all for your contributions. They always educates me. TimAI2's final answer wins the prize - thanks Tim.

And that would be? :wink:

A ride in my Cobra next time he's in Cape Town :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.