Search code examples
rformatquantmod

How to format the result from using Delt function in quantmod package in r


I have got a great result from using Delt function from quantmod package in R. However, the format of the result it not quiet how I want. It is something like -0.046984753. I want the number something as -4.7% if it makes sense!

help experts!!

Thank you!


Solution

  • Using scales

     library('scales')
     result=-0.046984753
     percent(result)
     [1] "-4.7%"