Personalized checkout and custom promotions with Shopify Scripts
I feel embarrassed by asking this question but I can't seem to find a string filter that will convert to a float/decimal number. I know the to_i does a nice conversion to int--but I tried to_f, float, decimal, etc. with no luck. I've googled my brains out thinking it is such a basic function but have only found folks talking about converting a float to a string, not the other way around.
My Google-Fu has failed me. All help is appreciated!
Solved! Go to the solution
This is an accepted solution.
float_number = string_number | times: 1.0
My apologies. I meant using liquid--I know I could do it using javascript. Just looking for a cleaner approach. I have updated the title.
This is an accepted solution.
float_number = string_number | times: 1.0
Thanks! That works.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025