round real in string
Function for rounding real given as string representation
str2B(str, base=10, round = 0)
str |
String representing a real |
base |
1 < integer < 17, base of representation |
round |
Integer, number of places after "." to be rounded; < 0: rounding places before least significand digit. If too negative, 0 will result. |
str2B
from given string represention of x
, round to 'round' decimal digits
Christian W. Hoffmann <christian@echoffmann.ch>
x <- paste0("- ","9167.8") str2B(x ) for ( kk in -5:4) print(str2B(x,10,kk) ) # 0 -10000 -9000 -9200 -9170 -9168 -9167.8 ...
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.