SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/09/2017, 06:41 PM   #1
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 161
Reputation: 0
Default format

Hi,

What is difference between %i and %d ?
Bussyman is offline   Reply With Quote
Old 04/09/2017, 06:43 PM   #2
Zeth
Gangsta
 
Zeth's Avatar
 
Join Date: Feb 2017
Location: Titan
Posts: 499
Reputation: 114
Default Re: format

There is no difference in it, both are same. Check this for more information.
__________________
server.one-rp.com
Zeth is offline   Reply With Quote
Old 04/09/2017, 06:50 PM   #3
10MIN
Banned
 
Join Date: Jun 2017
Location: Clock4ever
Posts: 332
Reputation: 30
Default Re: format

Technically there is a difference, but isn't important... The i from %i means integer aka not fractional number. The d from %d means decimal aka numbers in base 10, aka normal numbers.
10MIN is offline   Reply With Quote
Old 04/09/2017, 07:01 PM   #4
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 161
Reputation: 0
Default Re: format

So there is not specific situations when should i need to use %i or %d ?
Bussyman is offline   Reply With Quote
Old 04/09/2017, 07:03 PM   #5
Paulice
Gangsta
 
Join Date: Jul 2017
Posts: 470
Reputation: 44
Default Re: format

Both are the same, check the wiki.

SpecifierMeaning
%iInteger (whole number)
%dInteger (whole number)
%sString
%fFloating-point number (Float: tag)
%cASCII character
%xHexadecimal number
%bBinary number
%%Literal '%'
%qEscape a text for SQLite. (Added in 0.3.7 R2)
Paulice is offline   Reply With Quote
Old 04/09/2017, 07:05 PM   #6
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 161
Reputation: 0
Default Re: format

http://php.net/manual/en/function.sscanf.php

But in php function sscanf they are different? so in sa-mp function sscanf?
Bussyman is offline   Reply With Quote
Old 04/09/2017, 07:12 PM   #7
Paulice
Gangsta
 
Join Date: Jul 2017
Posts: 470
Reputation: 44
Default Re: format

"D" there is basically "f" in PAWN (this includes SSCANF).

Use "i" and "d" for integers, use "f" for floating point numbers (or fractions/decimals/whatever).
Paulice is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help in a Format JonathanW Scripting Help 3 01/09/2014 05:03 PM
help with format moof2010 Scripting Help 0 15/11/2013 10:02 PM
Please help me with this format AIped Scripting Help 4 10/11/2013 09:17 AM
Format again. How can I format() the vars? Seven_of_Nine Help Archive 9 13/04/2011 05:22 PM
Scripting with format or without format? godknightx Help Archive 4 08/12/2010 08:38 PM


All times are GMT. The time now is 11:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.