0

I have a column filled with numbers (generated with the runif function). I would like to transform the number to thousands.

To clarify:

column: 0.36984587
test_dataset$DEBT<-gsub("\\.", ",", test_dataset$DEBT)
|
column: 0,36984587
test_dataset$column<-test_dataset$column*1000000
|
column: 369845,87

I want to a tranform it to 369.845,87. How do I do that for 4000 rows?

Uwe
  • 41,420
  • 11
  • 90
  • 134
  • 1
    Do you mean transforming it to a string in order to contain the dot `.`? – Carles Mitjans Feb 16 '17 at 13:16
  • Essentially i want to transform numbers to thousands (delim '.' for thousands and ',' for decimal part) – John Michailidis Feb 16 '17 at 13:24
  • [this](http://stackoverflow.com/questions/29465941/format-number-in-r-with-both-comma-thousands-separator-and-specified-decimals) or [this](http://stackoverflow.com/questions/3838774/comma-separator-for-numbers-in-r) could help – Sotos Feb 16 '17 at 13:26
  • 3
    Possible duplicate of [Comma separator for numbers in R?](http://stackoverflow.com/questions/3838774/comma-separator-for-numbers-in-r) – Sotos Feb 16 '17 at 13:26
  • This looks like an i18n issue ([some](https://en.wikipedia.org/wiki/Decimal_mark#Countries_using_Arabic_numerals_with_decimal_comma) countries use a comma for decimal and a perhaps a period for thousands separators). – Fuhrmanator Oct 10 '17 at 19:24

0 Answers0