Hello there ScriptingHelpers! I have been trying to make a system that can shorten an int value into a string. eg: 1,000,000 Cash would become 1.0M cash and 1,100,000 would be 1.1M cash, I am trying to be able to make the string value appear on leaderstats whilst the actual numeric value is still stored in a folder. So if the user's cash said 3.2M Cash the datastore would convert it to 3,200,000 to store it, Would this be effective? Is there any way to improve it?

local leaderstats = game.Players.LocalPlayer.LeaderStats
local cash = leaderstats.Cash
local newleaderstats = Instance.new("Folder", leaderstats.Parent)
newleaderstats.Name = "OldValues"
local newcash = Instance.new("StringValue")
newcash.name = "Cash"

if cash.Value >= 999999 then
	cash.Parent = newleaderstats
	newcash.Value = "1.0M"
end

1 comment