Jump to content

Recommended Posts

I have some numbers such as 44.1, 44.2, 44.3,.....,44.10, 44.11 where I need to keep the last zero in the 44.10. My trouble is that if I set the data type as a decimal with 2 decimal places 44.1 becomes 44.10 which I don't want and if I save the data type as float then my 44.10 becomes 44.1. I have been able to retain the trailing zero by saving data as text but then it doesn't sort properly 16.x comes before 2.x. Hopefully someone can make sense of what I am trying to accomplish, thanks in advance for any help provided.

Link to comment
https://forums.phpfreaks.com/topic/226239-retaining-zeros/
Share on other sites

Sorry for the delayed reply, I've been caught up on other projects...anyway @DavidAM yes the data SHOULD be formatted like that unfortunately the existing data isn't and I am not able to change it.

 

@corbin thanks for the suggestion I will look into number_format and see what I can do.

Link to comment
https://forums.phpfreaks.com/topic/226239-retaining-zeros/#findComment-1171403
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.