|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
#include "article.h"
|
|
|
|
|
|
|
|
|
|
#include <iomanip>
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
|
|
// Article::Article() : Entity() {}
|
|
|
|
|
|
|
|
|
|
Article::Article(int price) : price_(price) {}
|
|
|
|
@ -24,4 +27,12 @@ Seller* Article::getSeller() { return sellerPtr_; }
|
|
|
|
|
|
|
|
|
|
int Article::getPrice() const { return price_; }
|
|
|
|
|
|
|
|
|
|
std::string Article::getPriceAsString() const
|
|
|
|
|
{
|
|
|
|
|
double sumInEuro = price_ / 100.0L;
|
|
|
|
|
std::stringstream sumStream;
|
|
|
|
|
sumStream << std::fixed << std::setprecision(2) << sumInEuro << " €";
|
|
|
|
|
return sumStream.str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Article::getArticleNo() { return articleNo_; }
|