Formatting a ToString("#.# ... Character alignment

Hello there, I’m making an XML editor script for saving and loading maps in a game.

When I write GameObject’s positions like so:

m_childTransforms[i].position.ToString("+000")

I get results like this:

Level Details:
Element 0: (000, 000, 000)
Element 1: (006, -078, 000)
Element 2: (012, -078, 000)

Can any tell me how I can keep these values in line with one another for easy reading?

Seems negative values knock it out of line. I was thinking perhaps if it always showed positive and negative instead of only negative?

If this can’t be done then that’s alright, I did my best, lesson learned :slight_smile:

1 Like