Formating decimal number

Is there a way to Round or Format a number in vbscript so that a whole number still has the decimal point. Using Round(1,3) removes the point and using Format(1,3) gives you 3 zeros.

Thanks Mark.

Maybe something like this will work (I’m assuming you want to output text for CNC…)

Option Explicit
Call Test()
Sub Test()
    Dim num, sep, split_str
    sep = "."
    num = Rhino.GetReal("Enter a number")
    If IsNull(num) Then Exit Sub
    split_str = Split(Cstr(num), sep)
    If Ubound(split_str) = 0 Then
        'number is a whole number'
        num = split_str(0) & sep
    End If
    Call Rhino.Print(num)
End Sub


Thanks, yes it is to output to a CNC. Partly I wanted to check there’s not an easy/obvious way to format the numbers.

Thanks Mark

what is the command to round at 10 or 100 up a floating.
for example, for 153.45 i want 160, is it possible?

Most any basic scripting thing like that which is not specific to Rhinocommon can be found with a simple Google search.

Assuming you mean vbscript like the original post:

Thanks!!! I search but i didn’t find…