Closed JDGrimes closed 7 years ago
Currently I don't think that this is really of value right now, since we are using number
inputs for all points values after #181. So our primary (only?) use-case is no longer valid. If we decide to allow decimal points values, there will be much more that will need to happen here, so let's close this for now.
We have the
wordpoints_format_points()
function to apply formatting to points, like a suffix and prefix. It would be nice if we introduced awordpoints_deformat_points()
function which could reverse this, converted the formatted points type back into a raw integer. The benefit of this is that it would be more generous when users enter points values into forms, for example. I can see it being especially good if points are being formatted with a decimal. However, there would still be other things to overcome there, like how to deal with an integer value entered with no decimal at all. That would be an ambiguous case. It could be handled by assuming that the decimal was implied to be after the number, but this wouldn't be backward compatible. That doesn't affect core in any case, but it is something that would need to be considered.