Changeset 18610a4 in observatorio


Ignore:
Timestamp:
Oct 23, 2014, 11:36:53 AM (10 years ago)
Author:
Alejandro <amujica@…>
Branches:
simulacion
Children:
b4d9743
Parents:
78c6ae6
Message:

corregido error en los numeros con formato

File:
1 edited

Legend:

Unmodified
Added
Removed
  • simulacion/SimEscenariosEconomicos/common.C

    r78c6ae6 r18610a4  
    211211}
    212212
    213 std::string numtostrRec(const real & num, const char & thousandSep) {
    214 
    215     if (num < 1000.0) {
     213std::string numtostrRec(const long long & num, const char & thousandSep) {
     214
     215    if (num < 1000) {
    216216
    217217        std::stringstream sstr;
     
    222222    }
    223223
    224     real aux = num / 1000.0;
     224    real aux = real(num) / 1000.0;
    225225
    226226    long long intPart = (long long) aux;
     
    228228    aux -= intPart;
    229229
    230     aux *= 1000;
     230    long long extract = aux * 1000;
    231231
    232232    std::stringstream sstr;
    233233
    234     sstr << aux;
     234    sstr << extract;
    235235
    236236    std::string str = sstr.str();
    237237
    238     if (aux < 100.0L) {
     238    if (extract < 100.0L) {
    239239        str = "0" + str;
    240240    }
    241241
    242     if (aux < 10.0L) {
     242    if (extract < 10.0L) {
    243243        str = "0" + str;
    244244    }
Note: See TracChangeset for help on using the changeset viewer.