Output of this code
System.out.printf("%d %(d %+d %05d\n", 3, -3, 3, 3);
there is
3 (3) +3 00003
Can someone explain why in this statement 3 is displayed as 3?
He is not, he is printed as (3)
(3)
From Javadoc for Formatter, say the flag (
(
Result encloses negative numbers in parentheses
Formatter help says that the format "(" means that it encloses negative numbers in parentheses.
In accounting, debt amounts are often represented in red numbers or a number in parentheses, as an alternative designation for representing negative numbers.
From Wikipedia: Negative Numbers
Source: https://habr.com/ru/post/1438231/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1438226/request-access-to-photo-library-during-app-launch&usg=ALkJrhiGsob7IBqghM_qBU6c2l7hccSk-gUIImage Thread Safety - iosError adding subclass element to ArrayList of superclass - javaTSI android 4.1 jellybean - androidiOS: Create UIImage from a background thread? - multithreadingHow to call void function from Main - c ++Disable compression in Windows Azure Preview - gzipGet the complete URL scheme and path for any iOS application - ioshow to create webapp using yiic command using Yii Framework - yiiRails best_in_place Editing jQuery: activation button not working - ruby-on-rails-3All Articles