What filter can I use to convert "$ 60,000 USD" into "60000"?
![pachocastillosr](https://us.v-cdn.net/6037124/uploads/userpics/MC7ELS8NG1HC/nPLP98RNMYYEZ.jpg)
Hi,
I'm receiving some prices through an external api and need to extract the price number.
What is the best way to to convert "$ 60,000 USD" into "60000"?
Thanks!
Best Answer
-
So your regex pattern should be in a place of variant_in_clinet_catalog.price
replacement should be left empty
subject should be your variant_in_clinet_catalog.price
Answers
-
From the top of my head I think I would go with regex_replace and build a regex for everything except numbers and then replace is with nothing.
-
Thanks for replying @Pawel Magdanski , I've tried this (see images below) without success.
What am I doing wrong?
This is the object where I am getting the price from:This is the regex:
Any help would be appreciated!
-
I think there is something wrong with your filter logic, see here:
-
@Pawel Magdanski I saw that but, to be honest, I don't understand it.
I just want to delete every non numeric character, so I left the replacement blank.
Perhaps you could give me a hand here @Michael Udinski? -
@Pawel Magdanski that worked! Thanks!
-
@pachocastillosr Great, happy to help!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback