Parser of berki style problems and generator of latex file
Samo Penic
2018-11-07 5bc997a926697e4ba120605a0f865284b5fbb27f
aoi_gen/Variable.py
@@ -35,7 +35,7 @@
        if formatting is None:
            formatting = self.formatting
        formatter = FormatterFactory.get_formatter(formatting)
        if formatting == "str":
        if formatting == "str" or formatting == "string":
            return formatter.toFormat(self.value)
        elif glyph is None and unit is None:
            return ("${}$").format(formatter.toFormat(self.value))
@@ -72,14 +72,16 @@
        type = spl[0]
        arglist = spl[1:]
        if type == "sci":
        if type == "sci" or type == "scientific":
            return SciFloatFormatter(arglist)
        elif type == "str":
        elif type == "str" or type == "string":
            return StringFormatter()
        elif type == "eng":
        elif type == "eng" or type == "engineering":
            return EngFloatFormatter(arglist)
        elif type == "dec":
            return DecFloatFormatter(arglist)
        elif type == "prefix":
            return PrefixFloatFormatter(arglist)
        elif type == "dec" or type == "decimal":
            return EngFloatFormatter(arglist) #fallback to engineering
        else:
            return None
@@ -178,7 +180,7 @@
        return float(man)
class DecFloatFormatter(EngFloatFormatter):
class PrefixFloatFormatter(EngFloatFormatter):
    def __init__(self, formatparameters):
        if len(formatparameters) != 1:
            raise Exceptions.WrongParameters("Dec format accept only one argument")