For a decimal, you could just use numericValue and countNumberUsage.
countNumberUsage(input.latex)=1
The above for example would just make sure only one number was used. Maybe this recent fraction question thread might be somewhere to start? Also, @JayChow has a youTube video that covers fraction patterns.