By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

How to convert display of poll options results?

P: 3
Please help.

I would like to convert a display of poll options results in percent from decimal numbers to floating-point numbers? How to do it?


Best regards

Emir
Feb 23 '07 #1
Share this Question
Share on Google+
2 Replies


ronverdonk
Expert 2.5K+
P: 4,258
Welcome to The Scripts!

How do you display a float? Or do you want to convert an integer to a float?
Or do you want to display an integer with comma's. I don't really get what you mean.
Converting an int value to float can be done
[php]$amount = (float) $amount;
[/php]
Displaying an integer with comma's like this:
[php]
$i=12345;
echo sprintf("x=%5.2f",(float)$i/100); // ==> result 123.45
[/php]

Ronald :cool:
Feb 23 '07 #2

P: 3
Welcome to The Scripts!

How do you display a float? Or do you want to convert an integer to a float?
Or do you want to display an integer with comma's. I don't really get what you mean.
Converting an int value to float can be done
[php]$amount = (float) $amount;
[/php]
Displaying an integer with comma's like this:
[php]
$i=12345;
echo sprintf("x=%5.2f",(float)$i/100); // ==> result 123.45
[/php]

Ronald :cool:

I have installed a phpBB forum at next URL:

http://www.hcu.untz.ba

This site is dedicated to handicapped persons. I have posted a poll at this site. The results of voting on poll questions are displayed as integer. I would like to display voting results as floating-point numbers. However, I don't know where is placed a file (or template) in which calculations of voting are done.

Please help me to change the display format of voting and eventually the form of voting calculations if they are done as integer.

Best regards
Feb 24 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.