Closed Souzooka closed 4 months ago
You cold use format()
or string concatenation to convert the integer to a string:
HourLookup[i] = format("{0}", hour)
or
HourLookup[i] = ""+hour
Ah, you're correct. I forgot about format for this purpose.
.
Currently, RATools mandates that all values in a lookup passed to
rich_presence_lookup
are strings. However, this limits the ability to programmatically generate lookups.For example, this simple code which generates lookups for a 12-hour clock:
if
HourLookup
is passed torich_presence_lookup
, the errorvalue is not a string
will be raised.This can be circumvented by transforming the dictionary again with a string conversion lookup, a la
but this should be unnecessary. RATools should instead attempt to convert values to string (for int, or other types if determined applicable) and instead raise an error along the lines of
value is not a string nor is convertible to string
.