Categories > Coding > Lua >

[HELP] float to int i guess

Posts: 1430

Threads: 71

Joined: May, 2022

Reputation: 20

Posted

Basically I need a way to convert a number like 192.39193192391293912399 to something easy to read like 192.3 or just 192, any way I can do that? also please respond or else im gonna loose my will to code for this day

https://media.discordapp.net/stickers/991374319924035634.png

 

edit: not math.floor() im working with small numbers

https://cdn.discordapp.com/attachments/967893353750482984/1015562174732718111/unknown.png

  • 0

i use arch btw

eb_

Formally known as Shade

vip

Posts: 1045

Threads: 4

Joined: Jun, 2020

Reputation: 47

Replied

https://github.com/eb-06/Lua/blob/main/CFrame.lua

 

U can see the round function in the script, shouldn't be hard to identify.

 

Edit: might not be what ur looking for nvm

  • 0

https://media.discordapp.net/attachments/1010636204225601659/1012865624797610044/sKQybOLT.gif

Posts: 1430

Threads: 71

Joined: May, 2022

Reputation: 20

Replied

@eb_

yea for me I wanted to leave out 1 or 2 numbers so that it doesnt just return 0

  • 0

i use arch btw

tar

CoolNickname

Posts: 142

Threads: 15

Joined: Jul, 2021

Reputation: 1

Replied

local a = 1.43453

print(math.floor(a * 10)  / 10) -- 1.4

  • 1

Added

@eb_ why the hell there is 3 same functions with different names

  • 0

https://imgur.com/a/oOomuUo

Posts: 1430

Threads: 71

Joined: May, 2022

Reputation: 20

Replied

@tar

https://cdn.discordapp.com/attachments/978212409145708565/1015616249297899590/holy-cow-holy.gif you saved my life!!

  • 0

i use arch btw

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )