a.masca Posted October 4, 2018 Share Posted October 4, 2018 Hello and thank you for the great job that all of you do every day on this great project!!! I have a little question: is possible to format the field float or decimal in this way: from 1000000.56 to 1.000.000,56 in repeater and repeater matrix? Thank you very much Andrea Link to comment Share on other sites More sharing options...
BitPoet Posted October 4, 2018 Share Posted October 4, 2018 Just for display in the repeater label? That can be done with a little hook in site/ready.php: wire()->addHookAfter('InputfieldRepeater::renderRepeaterLabel', function (HookEvent $e) { $label = $e->return; $page = $e->arguments('page'); $label = preg_replace_callback('/\\[([a-zA-Z0-9_]+)\\]/', function($match) use($page) { return number_format($page->{$match[1]}, 2, ',', '.'); }, $label); $e->return = $label; }); This looks for a field name between square brackets (something like "[price]" in "#n: {title} - {item} - [price]") in the label and replaces it with the formatted value of that field. 8 Link to comment Share on other sites More sharing options...
AswinC Posted June 20, 2023 Share Posted June 20, 2023 what about the value in the input field? I've a customer who is persistent about this ? Link to comment Share on other sites More sharing options...
wbmnfktr Posted June 20, 2023 Share Posted June 20, 2023 What exactly is your client looking for and where? In the backend or when the value is displayed on the website? 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