Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Convert text to a number Post Reply Post New Topic
Author Message
JNiemeyer
Newbie
Newbie


Joined: 25 Aug 2008
Location: United States
Online Status: Offline
Posts: 1
Quote JNiemeyer Replybullet Topic: Convert text to a number
    Posted: 29 Oct 2008 at 12:26pm
I have a text value ".281296" that I want to convert to a number. Whenever I use the Cdbl() or ToNumber() functions, it always rounds off the number to 2 decimal positions  .29  ???   Why does it do this, and how do I tell Crystal to convert the text to the number .281296 ?
IP IP Logged
o2bnsv
Newbie
Newbie
Avatar

Joined: 14 Aug 2008
Location: United States
Online Status: Offline
Posts: 8
Quote o2bnsv Replybullet Posted: 07 Nov 2008 at 12:17pm
you need to specify in the cdbl() formula how you want the number to format or how many decimal places you want.  For example, if you want your field to format to 6 decimal places, the formula would be as follows:
 
cdbl({table.field},"##.######").  There is a great crystal help article about formatting numbers as strings.  Just type 'format strings' into the help search.
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.047 seconds.