| View previous topic :: View next topic |
| Author |
Message |
w2m Member
Joined: 08 Mar 2003 Posts: 35 Location: New York, USA
|
Posted: 09/03/04 23:06 Post subject: Double as Fraction String |
|
|
Dumb question I guess...
If I have a variable ShutterSpeed: double that is 0.02 or 1/200 how can I display ShutterSpeed as 1/200 as a string?
0.05 = 1/50sec
0.01 = 1/100sec
0.02 = 1/200sec
0.50 = 1/2sec
I googled for a while but could not find anything that works.
Regards
Bill _________________ w2m |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 386 Location: Tehran, Iran
|
Posted: 17/03/04 09:20 Post subject: |
|
|
| Code: | | ShutterSpeedLabel.Caption := Format('1/%d sec', [Round(1 / ShutterSpeed)]); |
Hope that it helps.
Kambiz |
|
| Back to top |
|
 |
w2m Member
Joined: 08 Mar 2003 Posts: 35 Location: New York, USA
|
Posted: 20/03/04 15:19 Post subject: Thanks... |
|
|
Thanks... that did the trick... the method I was using was too complicated and used the lowest common denometer so it did not work with typical shutter speeds.
Bill _________________ w2m |
|
| Back to top |
|
 |
|