private static Expression ParsePrefix(ref string s) { s = s.TrimEnd(); if (s.Length < 2) { return(1); } if (Prefixes.TryGetValue(DeAliasPrefix(s[s.Length - 1].ToString()), out int prefix)) { // Make sure this isn't just part of the word before the prefix. if (char.IsDigit(s[s.Length - 2]) || char.IsWhiteSpace(s[s.Length - 2])) { s = s.Substring(0, s.Length - 1); return(((Real)10) ^ prefix); } } return(1); }
public string GetPrefix(ulong?id) => id == null || !Prefixes.TryGetValue(id.Value, out var prefix) ? DefaultPrefix : prefix;