How do i format numbers like in a clicker game "1M, 10B, 123ab..."

How do i format numbers like in a clicker game “1M, 10B, 123ab…”
I want to make a game line cookie clicker but i don’t know how to make numbers as big as 1e308 or bigger

There’s an asset on the marketplace that currently even is on a discount that you could take the mechanic from:

Preferably I’m looking for a solution that is not paid but thx

Here’s a code snippet at the bottom of the post that you can take inspiration from:

c# - How to code metric prefix (kilo,mega,giga etc) and do calculation on them? - Stack Overflow