num <- 12345.6789
formatted <- format(num, digits=6, scientific=TRUE)
print(formatted) # [1] "1.234568e+04"