|
by: Jason Tesser |
last post by:
I am using Rekall which uses Python as it's scripting language and I have a question about Python. I am developing a POS system and am working on
the checkout form. I pass a parameter named SaleID and another one named Total. I am trying to take total and convert it to a float with 2 decimals top be used as money obviously. What would be the proper syntax for this? I tried Total = round(Total ) i also tried that with float.
Jason...
|
by: Peter Scheurer |
last post by:
Hi,
we found some strange behavior when operating with floats and round().
The following simplified statement reproduces the problem.
select 6.56 - round(convert(float, 6.56), 2)
from sysusers where name = 'public';
===========
-8.88178419
|
by: David Corby |
last post by:
Hi everybody, I've got a problem.
I'm trying to round a double to a particular number of significant
digits, in this case 5, but I can't figure out a way around getting
_exactly_ what I want instead of _about_ what I want. Taken down to just
the part relevant to my question, here's the code, the desired result,
and the actual result...
double somenumber = round(2453126.7227083333 * 100000.0) / 100000.0;
desired: somenumber =...
|
by: Nobody |
last post by:
How does one round a float? ie... 4.4 returns 4, while 4.5 returns 5.
I see the floor and ceiling functions, but that floor would take 4.4 and
return 4 and ceiling would return 5. I guess I could find the part after the
decimal, but there doesn't seem to be a way to do that either. Other then
subtracting the floor and multiplying by 10 and taking the floor of that and
checking if its 5 or higher, but that seems really lame. There has to...
|
by: ng_mr |
last post by:
No, not a question about "banker's rounding" or whatever it's called.
I want to round a double to the nearest 100th, so I perform the
following:
// original is a double
double result = Math.Round( original, 2 );
But I'm not happy with the results. E.g. if original is
|
|
by: Steve |
last post by:
I have float value, let say 123.456789. How can I round it to two decimal
digits after decimal point?
For example:
123.456789 -> 123.45
It should be some simple way ...
Thanks
|
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;
|
by: Nader |
last post by:
Hello,
I have a list of tuple with strin elements. These elements are number,
but they are save as string. Now I will change the string to number
which will be rounded. An example will make it more clear.
t =
And I will have the next list:
|
by: Nimbus |
last post by:
In my case, if the float value is 74.716, it has to rounding into 74.72. But is that value is 74.715, it should be 74.71..
can anyone tel me what rounding ways i need to use?
Thanks in advance
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
|
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...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
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...
|