I am using sqlquery function in R to extract data from SQL Server database and one of the columns the value is 10.00 for example when querying within SQL Server. When I use this sqlquery function in R, the column is showing up as just 10, and I am needing to have it show as 10.00 within the dataset in R. The column in SQL Server is a decimal(10,2).
This is what I have for example:
library(RODBC)
data <- sqlQuery(connection, "SELECT amount from table1")
This will result in
amount
10
How would I be able to have this dataset show 10.00 for this column such as:
amount
10.00
It seems to show the decimal places if it's anything other than .00. I'd like for it to also show .00 as well.