I use a number formatter provide by java to reduce the number of decimal places to two positions after the decimal places.
I have a float variable whose value is 3.44567
and i use number formatter as shown:
NumberFormat fmt = new DecimalFormat("#0.00");
And convert it by fmt.format(num)
Later when i print the variable it prints 3.44 but when i pass this value to a stored procedure whose type is float and after saving it the number exists in the original format i.e 3.44567.
I dont understand that while printing on the screen it prints properly but when i see the database i get all the numbers even after two decimal places.
Can anyone guide how to rectify this.
Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!
This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts.
Introduce Scanner class:
Viewers will learn about basic arrays, how to declare them, and how to use them.
Introduction and definition:
Declare an array and cover the syntax of declaring them:
Initialize every index in the created array:
Example/Features of a basic arr…