Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:52 15 Jul 2025 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: 3285
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.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025