Tag

MessageFormat

1 views collected around this technical thread.

Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 4, 2025 · Fundamentals

Master Java String Formatting: 9 Practical Techniques with Code Samples

This article introduces a continuously updated Spring Boot 3 case collection and provides a step‑by‑step guide to nine Java string‑formatting methods—including String.format, MessageFormat, text blocks, number grouping, rounding, zero‑padding, printf, whitespace, and concatenation—complete with runnable code examples.

JavaMessageFormatString Formatting
0 likes · 6 min read
Master Java String Formatting: 9 Practical Techniques with Code Samples
Cognitive Technology Team
Cognitive Technology Team
Jul 5, 2022 · Backend Development

Avoiding Unexpected Comma Formatting of Large Integers with MessageFormat in MyBatis SQL Generation

When using MessageFormat to inject integer parameters into dynamically generated MyBatis SQL, large numbers are automatically formatted with commas (e.g., 10000 becomes 10,000), which can break SQL statements, and the article explains why this happens and how to prevent it by converting numbers to strings before formatting.

DecimalFormatIntegerFormattingJava
0 likes · 3 min read
Avoiding Unexpected Comma Formatting of Large Integers with MessageFormat in MyBatis SQL Generation