fix: remove invalid erase on price
This commit is contained in:
parent
5cf17d64f9
commit
a7e87335b1
@ -21,13 +21,13 @@ static std::string get_price(std::string& str)
|
||||
continue;
|
||||
}
|
||||
price += "€";
|
||||
break;
|
||||
str.erase(i - (price.size() - 3), price.size());
|
||||
return price;
|
||||
}
|
||||
else if (std::isdigit(str[i]) || str[i] == '.')
|
||||
price += str[i];
|
||||
}
|
||||
str.erase(i - (price.size() - 3), price.size());
|
||||
return price;
|
||||
return "";
|
||||
}
|
||||
|
||||
static std::string get_quantity(std::string& str)
|
||||
@ -52,7 +52,6 @@ static std::string get_quantity(std::string& str)
|
||||
int get_article_data(std::string& str, std::string& quantity, std::string& price)
|
||||
{
|
||||
price = get_price(str);
|
||||
std::cout << str << std::endl;
|
||||
quantity = get_quantity(str);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user