mirror of
https://github.com/RPCS3/rsx_program_decompiler.git
synced 2024-11-30 05:30:28 +00:00
Improved constant format
This commit is contained in:
parent
92dfc72284
commit
3c9c351bcf
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "builder.h"
|
||||
#include "fmt.h"
|
||||
|
||||
namespace shader_code
|
||||
{
|
||||
@ -47,8 +48,21 @@ namespace shader_code
|
||||
};
|
||||
|
||||
template<>
|
||||
struct native_type_t<type_class_t::type_float> : native_type_base_t<float>
|
||||
struct native_type_t<type_class_t::type_float>
|
||||
{
|
||||
using type = float;
|
||||
|
||||
static std::string to_string(type value)
|
||||
{
|
||||
std::string result = fmt::format("%.8g", value);
|
||||
|
||||
if (result.find('.') == result.npos && result.find('e') == result.npos)
|
||||
{
|
||||
return result + ".0";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
|
Loading…
Reference in New Issue
Block a user