alexm Posted April 19, 2023 Share Posted April 19, 2023 @kongondo When using $padloper->getValueFormattedAsCurrencyForShop() there is a space after the £ symbol which I notice on the demo site too. Where might one remove this space so it displays as £10.00 rather than £ 10.00? 1 Link to comment Share on other sites More sharing options...
kongondo Posted April 19, 2023 Share Posted April 19, 2023 Hi @alexm, 7 hours ago, alexm said: there is a space after the £ symbol which I notice on the demo site too. Where might one remove this space so it displays as £10.00 rather than £ 10.00? That's interesting. I am not seeing the space in my local dev nor in the starter demos. However, I am seeing it on the demo site as you point out. Not sure what's going on there. I know the demo site's Padloper is a bit old but that wouldn't be your case. PHP version differences? Meanwhile, maybe try and remove the space post the fact (str_replace())? 1 Link to comment Share on other sites More sharing options...
alexm Posted April 20, 2023 Author Share Posted April 20, 2023 @kongondo I was on php 8.0 I've just upgraded to 8.1 but still see the spaces. I did test 8.2 as well, but spaces still show. I wonder whether there's an unsanitised value getting passed to the number formatter somewhere. This would be my suspicion. I've tried str_replace with "£ " and "£ " as the needle neither works. Hence the suspicion. Haha ??♂️ Link to comment Share on other sites More sharing options...
kongondo Posted April 20, 2023 Share Posted April 20, 2023 @alexm, Try: <?php namespace ProcessWire; $formattedCurrency = str_replace(" ", "", $formattedCurrency); Link to comment Share on other sites More sharing options...
alexm Posted April 20, 2023 Author Share Posted April 20, 2023 @kongondo no dice my end. Who knows. Link to comment Share on other sites More sharing options...
kongondo Posted April 20, 2023 Share Posted April 20, 2023 @alexm. This one's a mystery. It works here just fine. I'll check what my server environment is for the demo to see if that sheds any light. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now