removed double setlocale(LC_NUMERIC,"C");