© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
J. Juneau, L. ManelliJava 17 Recipeshttps://doi.org/10.1007/978-1-4842-7963-2_4

4. Numbers and Dates

Josh Juneau1   and Luciano Manelli2
(1)
Hinckley, IL, USA
(2)
TARANTO, Taranto, Italy
 

This chapter helps you understand how to perform some of the most basic operations with numbers and dates that play a significant role in many applications. You learn to work with date, time, and time zone data. Moreover, the chapter provides examples that work with different kinds of numbers and format them to fit most situations. It also provides insight on performing advanced tasks such as working with currency.

4.1 Rounding Float and Double Values to Integers

Problem

You need ...

Get Java 17 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.