Sign in to follow this  
Followers 0
440LVB

Numbers format

8 posts in this topic

I'm sorry if the solution is in the help file, but as a French I don't know what keyword to seek.

I want to change the format of a number to print only the part before the comma on the screen ( $size is equal to 70.xxxx and I just wanna see 70 on the screen). Does anyone know what is the syntax?

Thank you for help, and sorry again if I could find the answer in help file.

Share this post


Link to post
Share on other sites



RESOLVED

Someone helped me, I used StringFormat() to define the message I want to print.

Share this post


Link to post
Share on other sites

Same kind of problem to find how to go to next line in a string (as '\n' do in C/C++), to have 2 lines in a MsgBox(). I don't know the word to say "go to next line and go to the beginning of the line" in English (equivalent to ENTER in a text file).

Share this post


Link to post
Share on other sites

Same kind of problem to find how to go to next line in a string (as '\n' do in C/C++), to have 2 lines in a MsgBox(). I don't know the word to say "go to next line and go to the beginning of the line" in English (equivalent to ENTER in a text file).

<{POST_SNAPBACK}>

=) It's '\n' character... Feel kind of stupid right now

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@CR

Carriage return, Chr(13); sometimes used for line breaks.

@LF

Line feed, Chr(10); typically used for line breaks.

@CRLF

= @CR & @LF ;occasionally used for line breaks.

MsgBox(4096,"Hello","Hello" & @CR & "440LVB!")
Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

@CR

Carriage return, Chr(13); sometimes used for line breaks.

@LF

Line feed, Chr(10); typically used for line breaks.

@CRLF

= @CR & @LF  ;occasionally used for line breaks.

MsgBox(4096,"Hello","Hello" & @CR & "440LVB!")

<{POST_SNAPBACK}>

$affich = StringFormat("Utilisé sur N: %i Mo \n\nEspace restant : %i\% \n",$size,$prct)
works well.

Thank you

Share this post


Link to post
Share on other sites

I'm sorry if the solution is in the help file, but as a French I don't know what keyword to seek.

I want to change the format of a number to print only the part before the comma on the screen ( $size is equal to 70.xxxx and I just wanna see 70 on the screen). Does anyone know what is the syntax?

Thank you for help, and sorry again if I could find the answer in help file.

<{POST_SNAPBACK}>

If you search for foramt in the help you get at the first "StringFormat" that's what you need I believe.

StringFormat("n=%d",$v)

You have other functions to do conversion or rounding :(

Share this post


Link to post
Share on other sites

Same kind of problem to find how to go to next line in a string (as '\n' do in C/C++), to have 2 lines in a MsgBox(). I don't know the word to say "go to next line and go to the beginning of the line" in English (equivalent to ENTER in a text file).

<{POST_SNAPBACK}>

@LF, @CR or @CRLF are macro that's can be used to generated the desire string

"line1" & @CRLF & "Line2" :(

Share this post


Link to post
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
Sign in to follow this  
Followers 0