Skip to main content
2 of 2
Routine clean-up
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259

How can I convert a fraction to a string that can be used in a file name?

I want add an index to the file names of my exported images, so I'm using ToString. But I have a problem when my index is a fraction, because then the generated file name includes characters not recognised by my system.

Is it possible to make $2\pi/5$ become, for example, 2Pi--5 or something similar when converting it to a string?

Enzo
  • 361
  • 1
  • 15