Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 08:26 19 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Reading Analog Input Explore 64

Author Message
envirotronics
Newbie

Joined: 18/02/2016
Location: Australia
Posts: 23
Posted: 08:04pm 10 Jun 2017
Copy link to clipboard 
Print this post

Hi all.
I am getting Analog input on a Explore 64 and printing it to a screen.
The result is anything up to 5-6 decimal places.
Is there anyway I can restrict the result to two decimal places?

Cheers
Graham
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 08:50pm 10 Jun 2017
Copy link to clipboard 
Print this post

Use the Str$() function.

For example: PRINT Str$(pin(x), 1, 2)

Geoff
Geoff Graham - http://geoffg.net
 
envirotronics
Newbie

Joined: 18/02/2016
Location: Australia
Posts: 23
Posted: 12:15am 12 Jun 2017
Copy link to clipboard 
Print this post

Thanks Geoff
That worked
Cheers
Graham
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024