Fix issues

This commit is contained in:
SilicaAndPina 2020-09-04 17:00:28 +12:00
parent a160c05a42
commit 348f3a4917
2 changed files with 1 additions and 12 deletions

View File

@ -427,7 +427,7 @@ namespace CXML
break;
case AttributeType.TYPE_FLOAT:
float FloatValue = bTreeTable.ReadSingle();
AttributeValue = Tools.RemoveDecimals(FloatValue);
AttributeValue = FloatValue;
TreeTable.Seek(4, SeekOrigin.Current);
break;
case AttributeType.TYPE_STRING:

View File

@ -10,18 +10,7 @@ namespace General
{
class Tools
{
public static String RemoveDecimals(float FloatValue)
{
String FloatStr = FloatValue.ToString();
String[] FloatParts = FloatStr.Split('.');
if (FloatParts.Length > 1)
if (FloatParts[1].Length > 2)
FloatParts[1] = FloatParts[1].Substring(0, 2);
FloatStr = String.Join(".", FloatParts);
return FloatStr;
}
public static void WriteStringToStream(Stream s, String str)
{
Byte[] bytes = Encoding.UTF8.GetBytes(str);