How do i make in if like >=0 <= 0.99. But i do not understand how to do that

  1. What do you want to achieve? Keep it simple and clear!
    Title
  2. What is the issue? Include screenshots / videos if possible!
    I don’t know how to do that
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i tryed to use >= 0 <= 0.99, but didn’t help

My code:

local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer
local Points = Player.leaderstats.Points
local PlayerGui = Player.PlayerGui
local GameGUI = PlayerGui.GameGUI
local Label = GameGUI.GameFrame.PlayableFrame.PointsShop.TextLabel
Points.Changed:Connect(function()
	if Points.Value >= 1000000 <= 999999999 then -- this place where i need to do that
		Label.Text = "Your Points: "..(Points.Value/1000000).."M"
	end
	if Points.Value >= 1000000000 then
		Label.Text = "Your Points: "..(Points.Value/1000000000).."M"
	end
end)
1 Like

use the and keyword.

if Points.Value > 1_000_000 and Points.Value < 999_999_999

Also this is a very poor way to suffix the point’s value. Consider something like this:

local function Suffix(Number, Precision)
    local Suffixes = {
        "", "K","M", "B", "T",
        "Qa", "Qi", "Sx", "Sp",
        "Oc", "No", "Dc", "Ud",
        "Dd", "Td", "Qad", "Qid",
        "Sxd", "Spd", "Ocd", "Vg",
        "Uvg"
    }
   
    local Index = math.floor(math.log10(Number) / 3)
    local Suffix = Suffixes[Index + 1]

    Number = Number / (10 ^ (3 * Index))
    Number = tostring(math.floor(Number * 10 ^ Precision) / 10 ^ Precision)
   
    return Number .. Suffix
end

Points.Changed:Connect(function()
    Label.Text = "Your Points:" .. Suffix(Points.Value, 0)
end)
2 Likes

if 999999999 >= Points.Value >= 1000000 or use andrew method

1 Like

Uhhh omg this is so hard, oh my god

This is invalid syntax. You can not do a >= b >= c. It must be written as a >= b and b >= c

1 Like

Can you explain with comments, i do not understand your script

Math behind it is simple.

It takes a number and gets its “magnitude” for lack of a better term.

The “magnitude” in this scenario represents what you would have to raise 10 by to get the original number.

In English we commonly suffix numbers every 3 powers, so we can divide this magnitude by 3.

We can then round this magnitude down so that we can use it as an index to a suffix array. This suffix array will be sorted by lowest suffix to highest.

1 Like

Oh nvm, you script works very good, but how do i add more suffixes??

I am surprised you “need more suffixes”. I provided a suffix list up to UVG (10^66) Simply add higher suffixes inside the table, but make sure the suffixes are in order from least to smallest.

1 Like

Okay thanks you very much, you are life savior!

ah, my bad, that worked in python only