Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Number to String formatting Post Reply Post New Topic
Author Message
dansken
Newbie
Newbie


Joined: 05 Jun 2008
Location: United States
Online Status: Offline
Posts: 1
Quote dansken Replybullet Topic: Number to String formatting
    Posted: 05 Jun 2008 at 12:22pm
I have a number field that can have 0 to 4 decimals.  I use the following code to format the decimals to not show trailing zeros.

if right(ToText(CurrentFieldValue,4),4) = "0000" then 0 else
if right(ToText(CurrentFieldValue,4),3) = "000" then 1 else
if right(ToText(CurrentFieldValue,4),2) = "00" then 2 else
if right(ToText(CurrentFieldValue,4),1) = "0" then 3 else 4


I have now been asked to create a second field that has this information in a barcoded format.  We use Precision IDs barcode package for 128 and it demands that the field is a string.  The function looks like this:

PrecisionID_C128_A ({CRYSTAL_PICKPLANS.QTY_PICKED})

If I add a ToText to the number field I loose my decimal formatting.

PrecisionID_C128_A (ToText({CRYSTAL_PICKPLANS.QTY_PICKED}))

How can I convert my number to a string keeping the decimal formatting?

Thanks,
--
Magnus Andersen
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.016 seconds.