Tagged articles

Long

12 articles · Page 1 of 1
SpringMeng
SpringMeng
Aug 3, 2026 · Backend Development

Long vs. BigDecimal: Which Is Best for Storing Money?

The article surveys ten community‑suggested approaches for representing monetary values in Java—ranging from using Long, BigDecimal, String, Protobuf, custom types, to following leadership or AI advice—highlighting each option’s rationale and trade‑offs such as precision, range, performance, and maintainability.

BigDecimalData TypesLong
0 likes · 4 min read
Long vs. BigDecimal: Which Is Best for Storing Money?
java1234
java1234
Jul 18, 2026 · Backend Development

Should You Store Money as Long or BigDecimal in Java?

The article explains why floating‑point types are unsafe for monetary values, compares the Long‑in‑cents and BigDecimal‑in‑yuan approaches, lists their advantages and drawbacks, and provides concrete Java code, database schemas, layer‑boundary conversion patterns, and common pitfalls.

BigDecimalFinancialLong
0 likes · 8 min read
Should You Store Money as Long or BigDecimal in Java?
Java Captain
Java Captain
Feb 27, 2026 · Fundamentals

Long vs BigDecimal for Money: Ten Community Perspectives

A developer asks whether monetary amounts should be stored as Long or BigDecimal, and the article compiles ten varied community suggestions—ranging from using Long, BigDecimal, String, custom types, Protobuf, leadership directives, AI answers, frugal choices, to whimsical ideas—each with brief explanations and illustrative images.

BigDecimalData TypesLong
0 likes · 4 min read
Long vs BigDecimal for Money: Ten Community Perspectives
Java Captain
Java Captain
Feb 16, 2026 · Backend Development

Long vs BigDecimal: Choosing the Right Java Type for Money

This article compares ten community‑sourced approaches for representing monetary values in Java, explaining when a simple Long, a precise BigDecimal, a String, custom wrappers, Protobuf tricks, leadership directives, AI assistance, or even minimal integer types are appropriate, and why each choice matters.

BigDecimalData TypesLong
0 likes · 3 min read
Long vs BigDecimal: Choosing the Right Java Type for Money
macrozheng
macrozheng
Feb 3, 2026 · Backend Development

Long vs BigDecimal for Money: 10 Community Perspectives

The article explores the common dilemma of choosing between Long and BigDecimal for monetary values, summarizing ten distinct community suggestions ranging from using Long, BigDecimal, String, Protobuf, custom types, leadership advice, AI assistance, to minimalist integer approaches.

BigDecimalData TypesLong
0 likes · 4 min read
Long vs BigDecimal for Money: 10 Community Perspectives
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 6, 2024 · Fundamentals

Long vs BigDecimal for Monetary Values: Which Is Safer?

The article examines the long‑standing debate over using Long or BigDecimal to represent monetary amounts, presents ten community‑sourced approaches with visual illustrations, analyzes the underlying precision problem, and concludes with a recommendation favoring BigDecimal for accurate financial calculations.

BigDecimalData TypesFinancial Computing
0 likes · 9 min read
Long vs BigDecimal for Monetary Values: Which Is Safer?
Cognitive Technology Team
Cognitive Technology Team
Aug 12, 2022 · Backend Development

Handling Large Integer IDs in Java and JavaScript: Preventing Precision Loss with Jackson Configuration

When generating large IDs using Snowflake-like algorithms, Java's 64‑bit long values exceed JavaScript's safe integer range, causing display errors; the article explains how to resolve this by serializing Long values as strings in Spring Boot using Jackson's ToStringSerializer, both via configuration and annotations.

ID SerializationJacksonJavaScript
0 likes · 2 min read
Handling Large Integer IDs in Java and JavaScript: Preventing Precision Loss with Jackson Configuration
Programmer DD
Programmer DD
Aug 15, 2021 · Fundamentals

Is Java’s long and double Access Truly Atomic? A Deep Dive

Through a multithreaded test program, this article explores whether Java’s 64‑bit long and double types are accessed atomically on 32‑bit and 64‑bit JVMs, explains the JVM memory model rules, and shows how volatility and hardware affect atomicity.

AtomicityJVMLong
0 likes · 10 min read
Is Java’s long and double Access Truly Atomic? A Deep Dive