Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal Reports formatting phone number

Posted on 2014-04-18
2
Medium Priority
?
3,858 Views
Last Modified: 2014-04-22
I have the following formula to format a phone number:

Picture(ToText({TABLE.FIELD}), "(xxx) xxx-xxxx")

But the result contains 2 decimal places, such as (555) 123-4567.00

Why is the .00 on there when I am converting it to text? I have tried:

Picture(ToText(Round({TABLE.FIELD},0)), "(xxx) xxx-xxxx")

But I still get the .00
0
Comment
Question by:altosax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 40009833
Unless you tell ToText and CStr how to format the number, it uses the system default which is generally 2 decimals

Try

Picture(ToText({TABLE.FIELD},0,""), "(xxx) xxx-xxxx")

That says 0 deicmal places and no thousands separator

You could also use

Picture(ToText({TABLE.FIELD},"0000000000"), "(xxx) xxx-xxxx")

mlmcc
0
 
LVL 35

Accepted Solution

by:
James0628 earned 2000 total points
ID: 40010241
If any of your phone numbers are 7 digits, with no area code, you may want to try to handle that.  mlmcc's second suggestion would put 0's where the area code would be, which may be good enough.  Another option would be the following, which would leave the area code blank if there were only 7 digits.

Picture(ToText({TABLE.FIELD}, "##########"), "(xxx) xxx-xxxx")


 James
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question