My boss had accidentally wrote it down but doesn't know how he did that. It would be pretty helpful to find out.
For Gboard: Just enable longpress for symbols in Gboard settings. Than find textbox and in lower left corner of keyboard switch to symbols, than longpress on some numbers will give you fraction or exponent.
With the SwiftKey keyboard navigate to your Numeric keys and long-press the number 5 to get ⅝ as an option.