From df586c9d2502523395b53d48ddd7dda8832c7a08 Mon Sep 17 00:00:00 2001 From: Makopoppo Date: Tue, 5 Jul 2011 22:19:26 +0900 Subject: Raw int numbers (ex.LSL Constants) are displayed like "1.000000" when type cast to string --- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index e0a4014..bf66b12 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1396,6 +1396,12 @@ namespace OpenSim.Region.ScriptEngine.Shared string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value); m_string=s; } + + public LSLString(int i) + { + string s = String.Format("{0}", i); + m_string = s; + } public LSLString(LSLInteger i) { @@ -1469,6 +1475,11 @@ namespace OpenSim.Region.ScriptEngine.Shared { return new LSLString(d); } + + static public explicit operator LSLString(int i) + { + return new LSLString(i); + } public static explicit operator LSLString(LSLFloat f) { -- cgit v1.1