{"description":"#include <iostream> #include <iomanip> #include <sstream> std::string doubleToStr(double value) { std::ostringstream oss; if (fmod(value, 1.0) == 0.0) { // \u5c0f\u6570\u70b9\u4ee5\u4e0b\u304c0\u306e\u5834\u5408\u3001\u6574\u6570\u3068\u3057\u3066\u51fa\u529b oss << std::fixed << int(value); } else { // \u5c0f\u6570\u70b9\u4ee5\u4e0b\u304c\u3042\u308b\u5834\u5408\u3001\u5c0f\u6570\u70b9\u3092\u542b\u3081\u3066\u51fa\u529b oss << std::fixed << std::setprecision(2) << value; } retur\u2026","provider_name":"Hatena Blog","blog_url":"https://blog.systemjp.net/","title":"MFC C++\u3067double\u578b\u306e\u5909\u6570\u304b\u3089\u5c0f\u6570\u70b9\u4ee5\u4e0b\u304c0\u306a\u3089\u6574\u6570\u306e\u6587\u5b57\u5217\u30010\u3067\u306a\u3044\u306a\u3089\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u542b\u3080\u6587\u5b57\u5217\u3092\u751f\u6210\u3059\u308b","version":"1.0","published":"2024-01-31 23:22:21","url":"https://blog.systemjp.net/entry/2024/01/31/232221","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.systemjp.net%2Fentry%2F2024%2F01%2F31%2F232221\" title=\"MFC C++\u3067double\u578b\u306e\u5909\u6570\u304b\u3089\u5c0f\u6570\u70b9\u4ee5\u4e0b\u304c0\u306a\u3089\u6574\u6570\u306e\u6587\u5b57\u5217\u30010\u3067\u306a\u3044\u306a\u3089\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u542b\u3080\u6587\u5b57\u5217\u3092\u751f\u6210\u3059\u308b - shikaku&#39;s blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"shikaku's blog","width":"100%","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/shikaku/","author_name":"shikaku","height":"190","type":"rich","categories":[]}