wowski
Electrical
- Jan 22, 2001
- 27
I can’t find an Fortran function that rounds a real number to a given decimal place (such as ROUND(x,y) in VB). The only way I’ve found of doing it which works but is ugly is, for the case of wanting to round to the third decimal:
dummyVar = 123.456789
dummyVar = TRUNC(dummyVar * 1000.0) / 1000.0
There must be a better way? Any ideas?
dummyVar = 123.456789
dummyVar = TRUNC(dummyVar * 1000.0) / 1000.0
There must be a better way? Any ideas?