עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ייצוג ספרות אחרי הנק' ב-JAVA

Featured Replies

פורסם

שלום,

מישהו יודע איך אפשר לקבוע כמה ספרות אחרי הנק' יוצגו בפלט ב-console??

תודה מראש...

פורסם

נניח שמוגדר לך משתנה מטיפוס double בשם d. אז:

System.out.printf("%.2f", d);

חפש עוד קצת על printf ועל format strings אם אתה רוצה להבין יותר.

פורסם
  • מחבר

דומה ל-C, וואלה, תודה...[br]פורסם בתאריך: 7.06.2009 בשעה 19:03:31


לא עובד, מקבל שגיאה בנוסח: The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (String, double)
פורסם

אצלי זה עובד מצוין.

כתוב כאן את הקוד המדויק שלך, ובאיזו גרסה של ג'אווה אתה משתמש.

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.