473,779 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting float value to integer value

119 New Member
Hai friends,

{$PRODUCTS_PRIC E}

This is my variable i dont know why they used { } for that. in that product_price i m storing a integer value like 112.00 etc.., when i change to another radio option, it automatically changes the value to 112.

What can i do to correct this to normal decimal value like 112.00,? help me dude!!!


thank you,
Nov 10 '08 #1
6 2421
Dormilich
8,658 Recognized Expert Moderator Expert
if it's a price use the money_format() function.
Nov 10 '08 #2
phpmagesh
119 New Member
if it's a price use the money_format() function.

Thankyou for your advice friend, but still i am not getting correct value (Note: i m editing the XT-Commerce shopping cart software).

They using smarty in this php. is that a matter plays in this Variable
Nov 11 '08 #3
Dormilich
8,658 Recognized Expert Moderator Expert
maybe i can tell you more with a convenient code snippet. the money_format() function does indeed need some requiremants... ..

regards
Nov 11 '08 #4
phpmagesh
119 New Member
maybe i can tell you more with a convenient code snippet. the money_format() function does indeed need some requiremants... ..

regards

Can you please tell me what are the requirements to work with that money_format() function,

is it possible for me to use that function,

Thanks in advance for your help and your time for me..
Nov 11 '08 #5
Dormilich
8,658 Recognized Expert Moderator Expert
all you need is described in the reference, maybe read some of the comments too. you should at least use set_locale().

regards
Nov 11 '08 #6
phpmagesh
119 New Member
all you need is described in the reference, maybe read some of the comments too. you should at least use set_locale().

regards

thankyou for your guidlines i got my output,

nice to meet you,
Nov 11 '08 #7

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

Similar topics

2
8067
by: Skeleton Man | last post by:
Hi, I have a script that generates numbers beyond the range of it, and so it's throwing them out as scientfic notation (e.g. 5E+10 instead of 50,000,000,000). The only way I've found of avoiding this is by using bc*() functions in place of normal operators (e.g. bcmul() instead of '*'). Surely there's a way to simply convert a number in scientific notation into a normal integer ? Regards,
3
118838
by: Nikola | last post by:
Hi all, I have a problem converting datetime to integer (and than back to datetime). Depending whether the time is AM or PM, same date is converted to two different integer representations, which holds as true on reversal back to datetime. AM Example:
25
6751
by: TK | last post by:
I'm used to programming in c or c++ in which my problem is simple. I want to be able to enter a value on a page (like 3.2), and then read it as a 32-bit float and break it into it's individual bytes. I've tried using bitwise operators, but they seem to convert the value into an integer first, and i've tried using the toString() method to convert it into a hex value so i can parse it, but that also seems to first convert it into an...
5
4548
by: Yodai | last post by:
Hi all! I have an int that comes with a value like 0x07fa and I have to turn it into a float value of 204.2 decimal to display it.... if I try to divide it by 10 I get bogus numbers. I presume I have to make it decimal before calculating, but I am not sure about it. Any light upon this simple (or it seems to me so, at least) begginner problem? TIA..
7
2710
by: Tor Aadnevik | last post by:
Hi, I have a problem converting values from Single to double. eg. When the Single value 12.19 is converted to double, the result is 12.1899995803833. Anyone know how to avoid this? Regards Totto
116
35996
by: Dilip | last post by:
Recently in our code, I ran into a situation where were stuffing a float inside a double. The precision was extended automatically because of that. To make a long story short, this caused problems elsewhere in another part of the system where that figure was used for some calculation and some eventual truncation led to the system going haywire. So my question is, given this code: int main() { float f = 59.89F;
8
3174
by: myfem.analyzer | last post by:
Hi, I saw a line of codes in the "Fast Inverse Square Root" like this: Float InvSqrt(float x) { ....... int i = *(int *) &x; //get bits for floating value ..... x = * (float *) &i; //convert bit back to float
4
1872
by: mthread | last post by:
Hi, I am using a string variable in which I do lot of appending. The only difficulty I am facing as of now is appending a integer/float value to this variable. Although I can accomplish this task using a stringstream variable, it makes my life difficult as it involves 2 function call(one for adding the information to stringstream variable and the other for copying that value in to string variable) with the additional burden of resetting...
13
1783
by: Pierre Quentel | last post by:
Hi, I would like to know if there is a module that converts a string to a value of the "most probable type" ; for instance : - if the string is "abcd" the value is the same string "abcd" - string "123" : value = the integer 123 - string "-1.23" (or "-1,23" if the locale for decimals is ,) : value = the float -1.23 - string "2008/03/06" (the format is also locale-dependant) : value = datetime.date(2008,03,06)
9
5171
by: ssubbarayan | last post by:
Hi all, I am trying a program to convert floating point values to a byte array and printing the same to the screen.The idea behind this is we already have an existing function which can do byte level parsing what ever may be the type of data.The data would be coming from an external environment.When I parse int,char at byte level,I get right values,where as floating point just prints 0.000000 to the screen.Given below is a sample program...
0
10138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.