Hi genius SAS people.
Can anyone help me with some truncate problem. I really appreciate it!
I have a dataset-->have as the following.
| have | |
| id | probability |
| 1 | 1.23 |
| 1 | 2.345 |
| 1 | 1 |
| 1 | 0.222 |
| 2 | 1 |
| 2 | 2 |
| 3 | 1.6678 |
| 4 | 0.8987 |
| 5 | 1.2345 |
| 5 | 0.4566 |
| 5 | 1.44888 |
Now, I want to multiply the probabilities and group by id. Also, I need to truncate the decimal places to 10 decimal places without rounding.
The following is how I want my result look like. Also, I would like to apply the truncate function to the whole column.
| id | probability | want | | |
| 1 | 1.23*2.345*1*0.222 | 0.6403257 | | |
| 2 | 1*2 | 2 | | |
| 3 | 1.6678 | 1.6678 | | |
| 4 | 0.8987 | 0.8987 | | |
| 5 | 1.2345*0.4566*1.44888 | 0.816694101576 | <-- | 0.8166941015 |