Discord Thread why does QT not work but the others (Q and Sx) don't work?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,755
1
0
The skUnity Discord
discord.gg
code_language.skript:
if {_n} contains "Q":
        replace all "Q" with "" in {_n}
        set {_c} to "%{_n}%" parsed as number
        set {_c} to {_c}*{_m}
        set {_n} to 0
    set {_m} to {_m}*1000
    if {_n} contains "Qt":
        replace all "Qt" with "" in {_n}
        set {_c} to "%{_n}%" parsed as number
        set {_c} to {_c}*{_m}
        set {_n} to 0
    set {_m} to {_m}*1000
    if {_n} contains "Sx":
        replace all "Sx" with "" in {_n}
        set {_c} to "%{_n}%" parsed as number
        set {_c} to {_c}*{_m}
        set {_n} to 0
    set {_m} to {_m}*1000

if {_n} contains "Qt":
just doesn't work but for some reason Sx works

Posted by: king_creeperz from the skUnity Discord. View the thread on skUnity Discord here
 
I would recemend the format snippet but if you would like to make your own thats fine
code_language.skript:
function format(n: number) :: string:
  set {_s::*} to split "k,M,B,T,Q,QI,S,Sp,O,N,D,U,Du,Td,Qa,Qi,Sx" at ","
  set {_div} to floor(log(max(abs({_n}), 1), 1000))
  return "%{_n} / (1000 ^ {_div})%%{_s::%{_div}%} ? ""%"
If you would like ?

Posted by: tslem from the skUnity Discord.
 
Status
Not open for further replies.