Remove all spaces from numbers

Hello2All

I would like to remove all spaces (blank / white space) from numbers
@ server side
just bevor or within the DB insert command

e.g.
bevor ‘6 700’
after ‘6700’ (all spaces gone)

Is there a wappler way to replace or delete all whitespaces in a number?

Thank you very much for your help
John

You could use the replace formatter like this:
{{$_POST.text_with_spaces.replace(' ', '')}}
I’m not sure if this is quite possible using the UI - it seems to wrap the quotes in extra quotes when trying to replace with nothing. (The quotes in this example are all single.)

1 Like

Great, TomD

Your Idea is allmost complete.
I had to change your fine solution a bit. Into…

{{$_POST.text_with_spaces.replace(’ ‘,’’)}}
(removing the space after the comma :wink:

I am very thankful for ur help.
Best regard, John

I’m glad that helped. I don’t think I particularly intended to include the space - but I don’t know why it would make a difference.

Just had to implement this again in a project.

The best way to remove spaces is by using .camelize() in the UI.

2 Likes

I just used the same thing in a project. It removes spaces from any string, numbers etc.
Here is the Camelize in case someone wants to use it.