Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: limit decimal display Post Reply Post New Topic
Author Message
Stephen W.
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: United States
Online Status: Offline
Posts: 7
Quote Stephen W. Replybullet Topic: limit decimal display
    Posted: 08 May 2009 at 12:43pm
I am trying to limit the number of decimal places to one decimal place for a particular data field. (###.#) "without rounding"

The data being pulled from my database is numerical data and it is in the format of 2 decimal places (###.##).


The first function I tried was ToNumber and then I would adjust the number display by using the "Format Editor-Number Tab":
(ToNumber({tests.test_res_val})

The problem is, when I go to preview my report, I am getting an error message stating that "The string is non-numeric.".



The other function I tried was Truncate:
Truncate({tests.test_res_val}, 1)

The problem with this is that it still sees {tests.test_res_val} as non-numerical with the error reading "A number, or currency is required here.".


Stephen W.
IP IP Logged
Stephen W.
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: United States
Online Status: Offline
Posts: 7
Quote Stephen W. Replybullet Posted: 08 May 2009 at 12:56pm
Mid({tests.test_res_val},1,InStr({tests.test_res_val},".")+1)


This worked!




Stephen W.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.029 seconds.