April 25, 2024, 06:19:21 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


STR$

Started by obelisk, December 24, 2020, 01:02:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

obelisk

December 24, 2020, 01:02:48 PM Last Edit: December 24, 2020, 01:31:19 PM by obelisk
Hi

I searched but can't find a solution.

I am using STR$(B) where B is 50.000
Then I am adding STR$(B) to an Istring but it keeps adding 50
It drops the decimal and trailing zeros

I tried setprecision but it doesn't seem to change the results

Can you point me in the right direction?

Thanks in advance

Egil

Hi there,

I ran into the same problem when I started using IWB. Don't remember exactly what I did, but I the solution came after experimenting a litte with formating text output. ( PRINT USING )

Attach a screendump of the UserGuide.



Merry Christmas!

Egil
Support Amateur Radio  -  Have a ham  for dinner!

obelisk

Thank you for the reply

I must be missing something.
No matter what I try, I still get only the whole number without the decimal point or trailing zeros.

billhsln

Try:

DEF fd="%d-###,###.##":STRING
DEF ftotal:DOUBLE

ftotal = 20.00

PRINT "\t\tTotal $"+USING(fd,ftotal)

Prints:     Total $20.00

Bill
When all else fails, get a bigger hammer.

obelisk