Changeset 18610a4 in observatorio
- Timestamp:
- Oct 23, 2014, 11:36:53 AM (10 years ago)
- Branches:
- simulacion
- Children:
- b4d9743
- Parents:
- 78c6ae6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
simulacion/SimEscenariosEconomicos/common.C
r78c6ae6 r18610a4 211 211 } 212 212 213 std::string numtostrRec(const real& num, const char & thousandSep) {214 215 if (num < 1000 .0) {213 std::string numtostrRec(const long long & num, const char & thousandSep) { 214 215 if (num < 1000) { 216 216 217 217 std::stringstream sstr; … … 222 222 } 223 223 224 real aux = num/ 1000.0;224 real aux = real(num) / 1000.0; 225 225 226 226 long long intPart = (long long) aux; … … 228 228 aux -= intPart; 229 229 230 aux *=1000;230 long long extract = aux * 1000; 231 231 232 232 std::stringstream sstr; 233 233 234 sstr << aux;234 sstr << extract; 235 235 236 236 std::string str = sstr.str(); 237 237 238 if ( aux< 100.0L) {238 if (extract < 100.0L) { 239 239 str = "0" + str; 240 240 } 241 241 242 if ( aux< 10.0L) {242 if (extract < 10.0L) { 243 243 str = "0" + str; 244 244 }
Note: See TracChangeset
for help on using the changeset viewer.