Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Split and round to 2 decimals stored in string usi Post Reply Post New Topic
Author Message
Sandhya
Newbie
Newbie
Avatar

Joined: 19 Apr 2011
Online Status: Offline
Posts: 1
Quote Sandhya Replybullet Topic: Split and round to 2 decimals stored in string usi
    Posted: 19 Apr 2011 at 1:36am

In SQL Server we stored the values in nvarchar(30). The values are concatenated with new line like this
908 "stored with new line in between \n "
85862.578
65.3
I want to round each values and display like this
908.00
85862.58 "Should be rounded"
65.30

May I know how to achieve this in Crystal Reports XI ?..
Thanks in advance..

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 19 Apr 2011 at 3:39am
SPLIT() the string on the chrw(13) + chrw(10) (the ascii equivalent of \n)
round the resulting members of the array, using a loop (see CR help for syntax)
then JOIN() the array back to a string to be displayed
 
HTH
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.031 seconds.