joer80 Posted September 11, 2019 Share Posted September 11, 2019 Is it possible to have a float field not drop an ending 0? Thanks! Link to comment Share on other sites More sharing options...
alxndre Posted September 12, 2019 Share Posted September 12, 2019 You could try using the FieldTypeDecimal module for this. If I remember correctly, there is a setting to specify number of decimal places in there. 4 Link to comment Share on other sites More sharing options...
dotnetic Posted September 12, 2019 Share Posted September 12, 2019 10.5 and 10.50 in terms of calculation is exactly the same. If you need this for output on the frontend side, then you could do a simple PHP number_format. 3 Link to comment Share on other sites More sharing options...
joer80 Posted September 12, 2019 Author Share Posted September 12, 2019 Its for the backend. People are entering money that I want to be sortable on the front end and it is odd to enter money into the backend and not have the option for 2 decimal spots. Link to comment Share on other sites More sharing options...
bernhard Posted September 12, 2019 Share Posted September 12, 2019 9 hours ago, alxndre said: You could try using the FieldTypeDecimal module for this. If I remember correctly, there is a setting to specify number of decimal places in there. +1 Your clients might also find this helpful: 1 Link to comment Share on other sites More sharing options...
joer80 Posted September 12, 2019 Author Share Posted September 12, 2019 The FieldTypeDecimal module worked to allow people to enter cents! Do you think this should be in core or if we should allow the core float field to do this? I would think entering money would be very common? Link to comment Share on other sites More sharing options...
bernhard Posted September 12, 2019 Share Posted September 12, 2019 This has been discussed before. I'm not against it, but I'm also fine with using the module. It works reliably. 1 Link to comment Share on other sites More sharing options...
gmclelland Posted September 12, 2019 Share Posted September 12, 2019 https://github.com/processwire/processwire-requests/issues/126 3 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