aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-12-25 21:14:43 +0100
committerlonkaars <loek@pipeframe.xyz>2022-12-25 21:14:43 +0100
commit908cb0e3db72cbcecb3b544ad5a406ec8b6d2236 (patch)
treefe15e52c97f3da8f443645194c146c7138ce1271
parent9c71ae716be8106092a52892818ae7a60e98e918 (diff)
format price properly in export csv
-rw-r--r--oop2eindopdr/ZipExport.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/oop2eindopdr/ZipExport.cpp b/oop2eindopdr/ZipExport.cpp
index 35c670f..eb0d60f 100644
--- a/oop2eindopdr/ZipExport.cpp
+++ b/oop2eindopdr/ZipExport.cpp
@@ -36,7 +36,10 @@ void ZipExport::export_zip(std::string filename) {
}
card->fetch_market_value();
- csv_content.append(card->id + "," + std::to_string(card->value) + "\n");
+ char* value_str;
+ asprintf(&value_str, "%.2f", card->value);
+ csv_content.append(card->id + "," + std::string(value_str) + "\n");
+ free(value_str);
zip_source* image = zip_source_file(zip, card->image_location_hires().c_str(), 0, 0);
zip_file_add(zip, std::string(card->id + ".png").c_str(), image, 0);