Re: How to make STR(14.2) display 14.2 as string? by Stephen
Stephen
Sun Feb 13 16:21:19 CST 2005
Sorry Mike, you are absolutely right - answer in haste, repent at leisure
Stephen
"Mike Gagnon" <mgagnon23@hotmail.com> wrote in message
news:%23tLpQkcEFHA.624@TK2MSFTNGP15.phx.gbl...
> Have you tried this?
>
>> lnValue = 123.45
>> ? STR(lnvalue,2)
>
> The second parameter in this example is "how many characters to display"
> rather than the decimals. If you are going to use this technique, you'll
> require a third parameter, how many decimals to show.
>
> lnValue = 123.45
> ? STR(lnvalue,2) && Show **
>
> lnValue = 123.45
> ? STR(lnvalue,6,2) && shows 123.45
>
>
>
>
>
> "Stephen & Shelagh Ibbs" <stephen@ibbs.org.uk> wrote in message
> news:RCHPd.99631$K7.1312@fe2.news.blueyonder.co.uk...
>> STR() requires a second parameter to tell it how many decimal places to
>> display. Try this:
>>
>> lnValue = 123.45
>> ? STR(lnvalue,2)
>> lnvalue = 14.1
>> ? STR(lnvalue,1)
>>
>> I always use LTRIM() as well to get rid of the leading spaces:
>>
>> ? LTRIM(STR(lnvalue,1))
>>
>> Sincerely
>>
>> Stephen
>>
>> "kd" <kd@discussions.microsoft.com> wrote in message
>> news:B7F994C6-AEC3-4D0C-AC9F-52D2B807DA60@microsoft.com...
>>> Hi All,
>>>
>>> I am sure there is an answer to this that I don't know of!
>>>
>>> I need to concatenate strings and values and display decimals as
>>> strings.
>>>
>>> For example:
>>> ?"Amount Due: $. " + STR(14.2)
>>> displays
>>> Amount Due: $. 14
>>>
>>> Is it possible to diplay the string as
>>> Amount Due: $. 14.2
>>>
>>> Thanks.
>>
>>
>
>