473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to convert display of poll options results?

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
2 1345
ronverdonk
4,258 Expert 4TB
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
Mirce
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

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

Similar topics

2
by: erica | last post by:
Hi, I am currently writing PHP code for some polling software. When someone votes, it stores their IP address in the database. From then on, they cannot vote in that particular poll, they only...
17
by: Doug Holton | last post by:
George W Bush, as certified by Florida's election commission. Which decorator syntax do you like the most? See http://wiki.wxpython.org/index.cgi/PythonDecoratorsPoll A. @classmethod def...
28
by: Paul McGuire | last post by:
Well, after 3 days of open polling, the number of additional votes have dropped off pretty dramatically. Here are the results so far: Total voters: 55 (with 3 votes each) Votes for each choice...
1
by: Zachovich | last post by:
' hi all ' suppose i have this: Dim strText As String = "Hello! <b>this</b> text <i>is</i> formatted" ' NOTE: i want the "this" to be bold and the "is" italic ' but when i do this:...
4
by: Jono | last post by:
Hi Everyone, As it says in the title, I'm looking for a way to display a page while long running operations are performed on the server. Ideally, I'd like some way to push the current request...
0
by: Mirce | last post by:
I have installed a phpBB2 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...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
2
by: webcm123 | last post by:
I'm making some changes in poll module. I don't know which method of storing options of poll is better. The main data of polls are in POLLS table. Speed and efficiency is the most important...
1
by: audiokarate | last post by:
Alright this is my hw problem. I am a newb with java and I am having a hard time coding. This is the problem and at the bottom is what I have so far. Any pointers in the right direction is greatly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.