From 908cb0e3db72cbcecb3b544ad5a406ec8b6d2236 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 25 Dec 2022 21:14:43 +0100 Subject: format price properly in export csv --- oop2eindopdr/ZipExport.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'oop2eindopdr') 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); -- cgit v1.2.3