For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > April 2006 > decimal presicion in text field









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author decimal presicion in text field
jpuentes75@hotmail.com

2006-04-10, 7:05 pm

Hello,

I hope my issue isn't to difficult. I would like to truncate the
number of decimals shown in a value (Value A) based on a value
contained within another field (Value B). (i.e. if (Value A) =
1234.567 and (Value B) = 2, I would like to only return 1234.56 if
(Value B) = 1, I would like to return 1234.5


The problem is that field A is a string field, and DOES contain
non-numeric values. I keep ketting errors when I try to use variations

of the follwing syntax within a formula field.


if isnumeric ({WB_REPORT_DATA.RESULT}) = true


then (tonumber({WB_REPORT_DATA.RESULT})) //dec precision needed
as well


else {WB_REPORT_DATA.RESULT} //non-numeric field


as you can see, I haven't addressed the decimal precision as of yet
either. Any assistance will be greatly apprecated.


Jay

Sébastien EDEL

2006-04-27, 7:07 pm

Hello

You said A is not a numeric value, but in your example, A is a numeric Value

What kind of other value do you have for A ???

<jpuentes75@hotmail.com> a écrit dans le message de
news:1144694571.378268.279090@v46g2000cwv.googlegroups.com...
> Hello,
>
> I hope my issue isn't to difficult. I would like to truncate the
> number of decimals shown in a value (Value A) based on a value
> contained within another field (Value B). (i.e. if (Value A) =
> 1234.567 and (Value B) = 2, I would like to only return 1234.56 if
> (Value B) = 1, I would like to return 1234.5
>
>
> The problem is that field A is a string field, and DOES contain
> non-numeric values. I keep ketting errors when I try to use variations
>
> of the follwing syntax within a formula field.
>
>
> if isnumeric ({WB_REPORT_DATA.RESULT}) = true
>
>
> then (tonumber({WB_REPORT_DATA.RESULT})) //dec precision needed
> as well
>
>
> else {WB_REPORT_DATA.RESULT} //non-numeric field
>
>
> as you can see, I haven't addressed the decimal precision as of yet
> either. Any assistance will be greatly apprecated.
>
>
> Jay
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com