part of number

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sooyke_
Posts: 25
Joined: 18 Nov 2020, 10:27

part of number

15 Oct 2022, 06:43

Code: Select all

z:=34.78511 

msgbox % z - floor(z)
Is there a better way of getting 0.78511 ( as a number )
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: part of number

15 Oct 2022, 06:48

Yes.

Code: Select all

z := -34.78511
MsgBox, % Abs(z) - Floor(Abs(z))
sooyke_
Posts: 25
Joined: 18 Nov 2020, 10:27

Re: part of number

15 Oct 2022, 07:25

Thanks , it also means i have to write my own function . I hoped there was something like Abs() . :facepalm:
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: part of number

15 Oct 2022, 07:29

It's not the most common way of seeing mod() but it seems to fit: MsgBox % mod(z, 1). Possibly with abs() or not.
sooyke_
Posts: 25
Joined: 18 Nov 2020, 10:27

Re: part of number

15 Oct 2022, 07:35

@safetycar

:thumbup: very nice ! Thank you .

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, Google [Bot], peter_ahk and 404 guests