Jump to content

[Solved]_5,9 == 6


Recommended Posts

Is ther an easier way? a built in func?

How do you determine is X 1 or 2 if the value is 0,5 ? is there maybe a standard or something?

$x = '1.9'

$array = StringSplit($x, '.', 1)

If $array[2] >= 5 Then $x = $array[1] + 1
    
ConsoleWrite($x & @CRLF)

EDIT: Solution is ROUND($X,0) because I want no decimal places

Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

@goldenix

are you looking to round up your numbers?

try: Ceiling Returns a number rounded up to the next integer.

Ceiling ( expression )

eg

$x = Ceiling(1.9)
ConsoleWrite($x & @CRLF)

You can also look at Round(), Floor(), Int()

Hope thats what you are after

Cheers

NBJ

edit: reference to Floor() Round() Int()

edit: after re reading again i I think you are after :

ROUND($X,0)

Edited by NBJ
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...