Hello everyone, I have a database with values saved as character. The number of decimal points can vary between observation I.e. both 10,132 and 6,254252 could be found. I want to convert these character values to a numeric value while retaining all decimal points. Using input(char,best.) yields me 1 decimal points. Simply multiplying the character string with 1 yields me 5. Exactly what is going on here, and how can i adjust the code to include all/more decimals? See example below. data test;
format CharVar $50. value_num1 value_num2 20.14;
CharVar="7663229328,8184132475796";
Value_num1 = input(tranwrd(CharVar,",","."), best.);
Value_num2 = tranwrd(CharVar,",",".")*1;
run;
CharVar= 7663229328,8184132475796
Value_num1=7663229328.800000000
Value_num2=7663229328.818410000
... View more