---
title: "Discussion on \"How to Use Format Strings (%)\" | Hashnode"
description: "Discussion on \"How to Use Format Strings (%)\". %d\nData Type: Decimal byte, short, int, long\nExample Usage:\nString temp = String.format(\"%d\", 29);\nSystem.out.println(temp); // 29\n\n%[Number]d\nData Type: Decimal byte, short, int, long\nExample Usage:\nString temp = String.format(\"%5d\", 29);\nSystem.out..."
url: "https://hashnode.com/posts/how-to-use-format-strings/65beb2718b39ecaae81ef61f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Use Format Strings (%)](https://eunhanlee.hashnode.dev/how-to-use-format-strings?utm_source=hashnode&utm_medium=feed)

%d Data Type: Decimal byte, short, int, long Example Usage: String temp = String.format("%d", 29); System.out.println(temp); // 29 %\[Number\]d Data Type: Decimal byte, short, int, long Example Usage: String temp = String.format("%5d", 29); System.out...

Feb 3, 2024 · 1 min read · eunhanlee.hashnode.dev  
Read the article

-   [#java-string-formatting](https://hashnode.com/tag/java-string-formatting)
-   [#o-x-f-e-s-c](https://hashnode.com/tag/o-x-f-e-s-c)
-   [#string-formatting](https://hashnode.com/tag/string-formatting)

## Written by

[Han](https://hashnode.com/@EunHaSu)

@EunHaSu · VA, US

  
[View profile](https://hashnode.com/@EunHaSu)

Java, Android, Algorithm

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
