• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

undesire rounding off of floating number automatically

i declare a variable as a floating number but when i assign a value of eg. 999999.99 it will be automatically round off to 1000000.00, is there a way to show the actual figure.

someone pls help, Thanks
0
kyh74
Asked:
kyh74
  • 2
1 Solution
 
rbrCommented:
This is not a rounding problem. 999999.99 can't be represented exactly in a float. Use double.
0
 
rbrCommented:
in general float has 6 significant digits and double has 15 signifacant digits.
0

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now