Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.
Users reporting for no reason may be locked out.
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Results;
using ATVO.ThemesSDK.Data.Enums;
namespace Scripts
{
public class iRating : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
if (value == null)
{
// do something appropriate, in this case probably just return nothing
return null;
}
IEntitySessionResult result = (IEntitySessionResult) value;
var irating = result.Entity.CurrentDriver.License.IRating;
var thousand = 0;
var hundred = 0;
if (irating > 0)
{
thousand = (int) (irating / 1000);
hundred = (int) (irating % 1000)/100;
return thousand + "." + hundred +"k";
}
else
return "-.-k";
}
}
}