Does Scala have a built in formatter for binary data?
For example to print out: 00000011 for the Int value 3.
Writing one won’t be difficult – just curious if it exists.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Scala has an implicit conversion from Int to RichInt which has a method toBinaryString. This function does not print the leading zeroes though.