Aran Member 882 Feb 13, 2007 #1 How the heck do i use sprintf? I'm trying to use this line in Game_Map: Code: @map = load_data(sprintf("Data/Map[COLOR=red]%03d[/COLOR].rxdata", @map_id)) and the part in red i need help with too... doesn't 3d draw 0 3 times or something like that?
How the heck do i use sprintf? I'm trying to use this line in Game_Map: Code: @map = load_data(sprintf("Data/Map[COLOR=red]%03d[/COLOR].rxdata", @map_id)) and the part in red i need help with too... doesn't 3d draw 0 3 times or something like that?
fuso Member 17 Feb 13, 2007 #2 %03d means format it as a decimal number (integer) preceeded by 0s so that the length is at least 3, i.e. 0 -> 000 3 -> 003 3443 -> 3443 http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_m_kernel.html#Kernel.sprintf Upvote 0 Downvote
%03d means format it as a decimal number (integer) preceeded by 0s so that the length is at least 3, i.e. 0 -> 000 3 -> 003 3443 -> 3443 http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_m_kernel.html#Kernel.sprintf