import clr
clr.AddReference('Soti.Connect.SemanticEngine.Conversions')

from Soti.Connect.SemanticEngine.Conversions import Converter

print("Loading MmToInchRange2To5 Converter")

class MmToInchRange2To5(Converter):

    def Execute(self, args):
        if args == None or args[0] == None:
            return

        MinBound = 2
        MaxBound = 5
        res = round(float(args[0])*0.039370078740157)
        res = MinBound if res < MinBound else res
        res = MaxBound if res > MaxBound else res
        return res




plugin = MmToInchRange2To5("MmToInchRange2To5")

store.AddConverter(plugin)