Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I display the truncated value as a value with 1 or 2 decimal places?
I don't really understand how to use the floor function.
@louise119 wrote:
I don't really understand the difference between floor() and round()...
Round() rounds up or down
Floor() always rounds down
Ceil() always rounds up
So floor(3.46,0.1) rounds down to the nearest single decimal place: 3.4
while round(3.46,0.1) rounds to the nearest single decimal place in either direction, which in this case is up, and gives 3.5.
ceil(3.46,0.1) rounds up to 3.5.
Try this
Round(FieldName, 1) //one decimal
Round(FieldName, 2). // Two decimal
Floor(FieldName * 10) / 10. // One decimal
Floor(FieldName * 100) / 100. // Two decimal
Thank you so much.
I tried.
When I used the "Round([Field name],1)", I thought it would display values with 1 decimal place, but it displays integers.
I don't really understand the difference between floor() and round()...
Should I use "Floor([Field Name],0.1)" when I express the 1 decimal.
@louise119 wrote:
I don't really understand the difference between floor() and round()...
Round() rounds up or down
Floor() always rounds down
Ceil() always rounds up
So floor(3.46,0.1) rounds down to the nearest single decimal place: 3.4
while round(3.46,0.1) rounds to the nearest single decimal place in either direction, which in this case is up, and gives 3.5.
ceil(3.46,0.1) rounds up to 3.5.
Thank you so much!
I could understand.
In your first example (the screenshot of the table) you have floor([customer number]/3,1]
The step is 1 so floor() rounds down to the nearest single digit. For example:
floor(10/3,1) gives 3, the next lowest to 3.3333333... in steps of 1
If you change the step to 0.1, floor() rounds down to the nearest decimal place. For example:
floor(10/3,0.1) gives 3.3, the next lowest to 3.3333333... in steps of 0.1
Thank you so much:)!