Raised This Month: $ Target: $400
 0% 

Digits of an Integer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-03-2015 , 05:44   Digits of an Integer
Reply With Quote #1

Is it possible to format only a certain amount of digits from an integer when formatting into a string? Like you could with a float e.g "%.5f"?

Lets say the integer is 12345678. Formatting that into 4 digits should turn it into 1234. While if my number was 23, it would be formatted as 0023. I know you can do the latter by doing "%04i".
PartialCloning is offline
 



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

Forum Jump


All times are GMT -4. The time now is 17:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode