Restrict user input to round numbers

How can I restrict a user input only to accept multiples of $1000, i.e round the amount the user enters to the nearest $1000? If the user inputs: $849 I want the input to display $1000.

Hmm :thinking:

Ok, someone will have to chime in if they have a better solution. I am struggling with the math a bit to make it simpler than this. Here you go:

Editor: testApp42wCleanDB | Bubble Editor

Preview: https://testapp42wcleandb.bubbleapps.io/version-test/restrict_user_input_to_round_numbers?debug_mode=true

Does that do what you are trying to accomplish? Let us know. :blush:

Maybe there is a way to use :rounded instead?

1 Like

Got it! Here it is using :rounded.

Editor: testApp42wCleanDB | Bubble Editor

Preview: https://testapp42wcleandb.bubbleapps.io/version-test/restrict_user_input_to_round_numbers_rounded?debug_mode=true

Does that help? :blush:

1 Like

Very impressive, J8. It works! I just had to set the state upon page load to the initial content I wanted. Good work!

Hmmm, I have other work perhaps you can help me with. :slight_smile:

1 Like

Awesome :clap: Glad it worked.

Yeah, I am happy to assist. You can book a coaching session with me anytime I am available. We also offer development work as well.

If you need some free help, just post on here and I will see what I can do to assist when I am available. :blush: