Fix issues
This commit is contained in:
parent
a160c05a42
commit
348f3a4917
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue