<p dir="ltr">%s will be the placeholder for a string and %d for a number. If you used say 15 as the value, and the template is %s you will get 15.to_s and is the value was "15" and the template was %d, the value will be "15".to_i. In other words it will try to do the appropriate conversion. So given your example it worked. But let's say your template was %d, if you pass as a value 15 or "15" that would work, but "fifteen" will throw an error. %s will work, in all cases, but may not be what you want.</p>
<p dir="ltr">HTH<br>
Kevin</p>
<div class="gmail_quote">On Oct 11, 2014 1:35 PM, "Michael Havens" <<a href="mailto:bmike1@gmail.com">bmike1@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Well, I've decided to try to learn python. Right now I'm on 'format string'.So there are different ones, right? Well, I'm working with %d and %s right now and if I change the %d to a %s I get the same result when I run the program. My question is %x just a place holder or do they have special meanings?<br clear="all"><div>:-)~MIKE~(-:</div>
</div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div>