They are supposed to be pH values, normal format: 7.40
The trouble is, many say:
4.42, when it should be 7.42
7036, when it should be 7.036
696, when it should be 6.96
.701, when it should be 7.01
For the first example, I need to replace any non 7 integer ahead of the decimal with a 7. Example with 4.
I attempted
Code:
replace var=7.* if var==4.*
For the last 3 examples, I simply need to move decimal places, which I could do by multiples or divisions of 10,100, etc. However, must I manually adjust each one, or can I somehow indicate that each observation "formatted" as **** or *** or .*** should be replaced by *.*** ? This would need to actually involve changing the numbers' true values, not just changing format in variable properties.
Thank you.
0 Response to changing numbers that surround decimals
Post a Comment