How do I move a decimal point over to the left
if I have this number 1.01 and I want to convert it to .101
Thanks
You could divide it by ten, or you could multiply it by one-tenth, or you could multiply it by one hundred and then divide it by one thousand. Are you serious? What's the real question?
I dont want to move the decimal point with arithmitic dick head (tomhath) I want to move it dynamically with a function or some type of float manipulator
I thought you were dealing with string of chars and not numeric, but if it's numeric, what's wrong with dividing by ten ?
Dividing by ten is fine when dealing with int, float etc... However I want to know if there is a way to do this with a php function for strings.
Errr - why bother... cast it as an integer... then divide by 10... and cast it back to a string?
Well,
I don't see a specific function for that purpose but :
with strchr() looking for the position of the '.'
with substr(), cut the string as needed
then concatenate back everything
Hervé.