 Hello guys, welcome back to the idle game tutorial series part 4 Today we're gonna be working on exponents Which is basically making so that instead of a thousand It would say one e to the three It just makes a lot cleaner. So I'm gonna grab an example already have right here Okay, there you go. We have our this basically this whole thing right here Um adds the exponent it looks quite a bit, but it's not too bad. Trust me It's better than what I've done in the past So we're gonna start with the click value one So we can delete this or actually we can replace whatever text needs to be inside So just copy that copy that and then to the add to the end of these plus coins plus coins And then we can delete this All right, so our text name is click value text we'll replace it with this one too and the thing we're trying to Change or make it show the exponents is the click value Here hold on It's oh are doing coins. Oh it is coins click value. Okay So we're doing coins click value Replace it with every single one of these if we were doing the coins one this would be coins You'll see it's really it's really the same thing I could make a method where I'm actually does this but I really really don't want to do that Because this just looks easier So we're not doing big double. We're doing math F math F math F. All right, so I You cannot convert from double to float Don't hate this. This is why he's big We're just gonna convert this to float Basically if this was greater than 1838 you're pretty screwed Can you actually do math? Oh you can I forgot about that method Okay, so what you guys can actually do for this instead of doing the floats you can do system.math this basically allows you to Do certain math equations with doubles instead of floats because math F is for floats only or It can be used for doubles, but it can only be in the range from whatever floats min and max value is so we'll do system.math and Basically, this is it It's that simple and if we want to do another one the coins text We'll just replace. We'll just copy and paste it Copy the coins text Make sure all of the strings part of the text right here says coins that makes sense delete those parts and Delete that because we know right here. We're basically using coins coins coins coins So basically a rundown for what's up for what this does is that the exponent is grabbed by a series of math equations So it takes one thousand and it finds how many digits are in here We know there's three how many zeros are in here. So we know that There's three. So the exponent is three. Okay, the Manatee's I think it's how it's pronounced is found by The exponents we divide it so simply Let's say let's take that This is the exponents. This is the manatee. So so we get this number by dividing whatever coins is by this So we know that If we do one two three four if we divide that by four you get oh Hold on. No, no, no, no if we get ten to the four Come on. It's not cooperating with me If we divide that by Sorry, it should be it. Oh, this is three actually oops. There you go. So you'll get this. This is the manatee sir, which is 1.234 1.234 E3 So that's how the exponent system works and if it's less than it's a blade It just displays a number regularly wants to greater than a thousand That's when we applied the exponent system. So let's give that a shot. Let's try to get to over a thousand We changed nothing with tech. We didn't add anything to the scene Okay So so by default it's displaying two zeros two digits. That's because I have at two I forgot to change this to at zero at zero So we see decimals once it's greater than a thousand and you'll see how what it looks like It's cool how it works All right, here we go. There you go. That's where the exponent system is applied So we know this is around 1070 we're gonna divide that by 10 to the power of three and Then we got 1.7. That's what this number is and Then we have the three digits here. That's how we get three and Yeah, now you got yourself a number system So there you go That's that you can replace it for everything you want to but I'm back I feel like that's a waste of tutorial time So you can do that for everything if you want to again, it's just a simple of taking this replacing with that And if you have any more text Then do that. So we're gonna do one more click We're actually gonna do one more upgrade because this one's a series of numbers to add on to If we had to upgrade like two big numbers that we want to show exponent systems to we got to make two strings So we're gonna do this So we're gonna do this twice So here we go. We got two of these right here We're gonna do the click upgrade cost Which will the level we won't see any time soon because we got to buy that thousand times That's a lot, but we're gonna take the level for the second one oops Here you go. Here you go. So this string is gonna be oh My goodness, that's not what I wanted at all string We're gonna make that a temporary replace the coins text with this too and then for this one we're gonna need Level this is where we don't use the dot text because it's only string There you go. So we don't need these extra this extra letters or words in here So the string so we're just gonna get rid of it. So it's just numbers. It's pure numbers So we basically have this all set up now, what do we do? We replace everything in here Oops, I actually do that What I do here Okay, so we're gonna take this cost ring replace it with this right here and We're gonna do the same thing with the level. There you go. It's done It'll display this exact same thing, but once this becomes a thousand it will show the exponent system It'll show it's exponent and basically this is scientific Scientific if you're running what then the number format was So, let's see can we get cost to a thousand? Let's see now if we get this to 10,000 it will display as one e4 See, it's really simple. It's really convenient to it. It's really easy on the eyes There you go. See there it is it displays everything as normal and then we have our exponent right here But once this level gets to a thousand it'll do the exact same thing So anyway guys, thank you for watching this video for recap We basically just developed a text exponent system that automatically transforms one thousand to the scientific form just one to the e3 or one e3 and then we Try different ways of displaying an upgrade and that's it. Thank you guys for watching. I'll see you guys in episode four or episode five Yeah