Reputation: 187
I have a string value which size 11(2): 00000700000
I want to convert this string to decimal. I clean leading zeros with ltrim
function and then put comma at the end of the value with the function substr_replace
:
ltrim(substr_replace( '00000700000', '.', -2, 0), '0')
The expected result is:
7000.00
Are there any cleaner way to separate last two digits with dot and convert this string to decimal?
Upvotes: 0
Views: 49