std::string num = "0.6"; float temp = ::strtof(num.c_str(), nullptr);
0.600000024
std::string num = ""2999.6"; float temp = ::strtof(num.c_str(), nullptr);
2999.60010
float myAtof(string& num) { floattmp; sscanf_s(num.c_str(), "%f", &tmp); return tmp; } float myround(float var) { float value = (int)(var * 100 + .5); return (float)value / 100; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)