How to get my currency to show up as dollars/cents?

I have my game set so that when you earn a penny it increases a float by o.o1f, when you collect nickel it increases by 0.05f and when you collect a dime it increases by 0.1f. However the money text ends up showing this somehow: 52492-untitled432.png

I cant seem to figure out why if i’m increasing it by .01, .05, or .1 how I can end up with .0000.

is there a better way to create currency, or am I just simply doing something else wrong?

This is my script it is in c#.

  void OnTriggerEnter(Collider other)
	{
		if (other.tag == "penny") 
		{
			Destroy (other.gameObject);
			GameController.Money = GameController.Money + GameController.pennyWorth;
			GameController.LME = GameController.LME + GameController.pennyWorth;
			GameController.penniesInGame =  GameController.penniesInGame - 1;
			GameController.coinsInGame = GameController.coinsInGame - 1;
			GameController.METS = GameController.METS + GameController.pennyWorth;
		}

		if (other.tag == "nickel") 
		{
			Destroy (other.gameObject);
			GameController.Money = GameController.Money + GameController.nickelWorth;
			GameController.LME = GameController.LME + GameController.nickelWorth;
			GameController.nickelsInGame =  GameController.nickelsInGame - 1;
			GameController.coinsInGame = GameController.coinsInGame - 1;
			GameController.METS = GameController.METS + GameController.nickelWorth;
		}

		if (other.tag == "dime") 
		{
			Destroy (other.gameObject);
			GameController.Money = GameController.Money + GameController.dimeWorth;
			GameController.LME = GameController.LME + GameController.dimeWorth;
			GameController.dimesInGame =  GameController.dimesInGame - 1;
			GameController.coinsInGame = GameController.coinsInGame - 1;
			GameController.METS = GameController.METS + GameController.dimeWorth;
		}
	}

You are likely running into floating point imprecision here. Your best bet would probably be to convert your floats into ints and represent your currency as an amount of cents rather than dollars, converting it to a float right before displaying it.

Not exactly the answer but this page helped me in my currency game. Could prove useful to someone https://gamedevplanet.com/number-formatting-in-unity-useful-c-tostring-formats/