DroidDB Tip of the Month

DroidDB® Tip for September 2017

Decimal Digits Displayed by a Calculated Control

When a calculated control is displaying a floating point number, it displays six decimal digits. If it is displayed as "Money", it displays two decimal digit. But what if you wanted to show one, three, four, or five decimal digits?

Say you have a column in your table called MyFloat whose datatype is Float. First, in the properties of the calculated control, set the display type to "Text". Then:

  • To display one decimal digit, use the expression: @left(@round(MyFloat, 1),@length(@round(MyFloat, 1))-5)
  • To display two decimal digits, use the expression: @left(@round(MyFloat, 2),@length(@round(MyFloat, 2))-4)
  • To display three decimal digits, use the expression: @left(@round(MyFloat, 3),@length(@round(MyFloat, 3))-3)
  • To display four decimal digits, use the expression: @left(@round(MyFloat, 4),@length(@round(MyFloat, 4))-2)
  • To display five decimal digits, use the expression: @left(@round(MyFloat, 5),@length(@round(MyFloat, 5))-1)

 

Back to List »

Visit our store

Top rated! I needed a solid database application development tool for mobile devices. I chose DroidDB for Android OS because it provided a way to get a strong product to market quickly. DroidDB is relational, gives me control over form layout, handles macros, and supports events. It works on all Android versions I have tried and is a great companion product to SYWARE’s VisualCE.

Mark Read, President
SyntegraTech, Inc.

signup for our newsletter