float

Floats and Margin Collapse

Hi, so I'm having a hard time understanding the circumstances under which a float can have margins collapse through it and how that affects the position of the float. I've included a page that seems to show two different behaviors in the same page. The red float seems to be positioned before the margins that collapsed through it, where...

IE6 bumps down content when the parent container is too narrow

In the following example, the right side container appears to the right of the left side one in standards compliant browsers, but in IE6 the blue right side container appears below the left side one. IE6 effectively bumps it down because the parent container is narrower than the total width of the left and right side containers. I hav...

Non-exponential formatted float

Hello, I have a UTF-8 formatted data file that contains thousands of floating point numbers. At the time it was designed the developers decided to omit the 'e' in the exponential notation to save space. Therefore the data looks like: 1.85783+16 0.000000+0 1.900000+6-3.855418-4 1.958263+6 7.836995-4 -2.000000+6 9.903130-4 2.100000+6...

sprintf() to truncate and not round a float to x decimal places?

Hi folks, When calculating a golf handicap differential you are supposed to truncate the answer to 1 decimal place without rounding. No idea why but... I know how to do this using TRUNCATE() in mySQL SELECT TRUNCATE( 2.365, 1 ); // outputs 2.3 but I was wondering if sprintf() could do this? The only way I know to work with decim...

error C2664 + generic classes + /Wp64

Hi! I've got the following lines of code: p_diffuse = ShaderProperty<Vector4>(Vector4(1,1,1,1)); addProperty(&p_diffuse, "diffuse"); p_shininess = ShaderProperty<float>(10.0f); addProperty(&p_shininess, "shininess"); the addProperty function is implemented as follows: template <class A_Type> void IShader<A_Type>::addProperty( Shade...

CSS Problem with Overflow with div

I want to use overflow on a div to show all div and image, and text to but for this example i used only images. i need a horizontal scroll, if i only use image its work well with the white-space: nowrap; css but if each images are in a div the sroll disapear and images don't show all. Example 3 here the first exemple work if i give a ...

Wrong float warping in IE7

Hello, here's test page, which looks differently in IE7, while OK in Firefox & Opera. Looks like FF & Oprah are adequate about .twoColLiqRtHdr #mainContent { margin: 0 20px 0 10px; } right margin and place text accordingly (text fills space under sidebar), while IE uses #sidebar's left border as margin, and, as a result, that s...

Convert float to string with cutting zero decimals afer point in Python

Hi all! I am feeling difficult to convert a float to string in the following manner: 20.02 --> 20.02 20.016 --> 20.02 20.0 --> 20 Seems "%g" format is the best for that, but I am getting strange results: In [30]: "%.2g" % 20.03 Out[30]: '20' In [31]: "%.2g" % 20.1 Out[31]: '20' In [32]: "%.2g" % 20.3 Out[32]: '20' In [33]: "%....

Ie7 float right bug?

I have a div floated right. Inside that div are two other divs. The first div has a background color and when I refresh, it's "bleeding" into the second div. (Sometimes in front of it sometimes behind it.) When I scroll, it fixes itself. When I refresh it does it again. This is only happening in IE7. Bug? code below #sidebar {float...

How can a float representation be off 1 from a decimal representation in perl?

I ran across an interesting issue in some of my "humanize_bytes()" code. This loop represents the issue without all the other logic. The loop needs to stop when the bytes have been truncated to a "human readable" level. It keep iterating until the final value is less than 1024 (or specifiable bytesize). I started looking into the pro...

IE 5.5 Float Drop in css div layout

Hi, I'm testing a site for a friend and I've got it to work in all browsers, except IE 5.5 (Looks great in Adobe Browser Lab for all Browsers.) You may ask why I care about IE 5.5 - well I'm pretty familiar with IE 5.5 bugs (especially the bug where it counts borders and padding inside the space it needs to display an element) and can ...

CSS Parent DIV Overflow

I have a problem with a website I'm putting together. I have a simple div layout. Which is as follows: <body> <div id="Container"> <div id="Logo"></div> <div id="Banner"> <div id="Nav"></div> </div> <div id="Content"> </div> <div id="footer">Footer</div> </div> </body> And my CSS is as follows: @charset "utf-8"; /* CSS Docum...

Getting CSS to "float: right" and vertically center

Hello.. I am having some problems getting a small piece of text to be centered while floating next to an image. <html> <head> <style type="text/css"> img { float:right; } </style> </head> <body> <p>In the paragraph below, we have added an image with style <b>float:right</b>. The result is that the image will float to the right in the p...

method to display float in datetime format

I need a method in c# that makes me a string that look like a datetime out of a double/float. for example 1.5 -> 01:30 2.8 -> 02:48 25.5 -> 25:30 (note: don't display as day, display full hours even its more than 24) ...

IE6 floated element wrapping problem

I am trying to get tags to wrap to the next line by left floating them. In firefox the text will wrap onto the start of the next line, however IE6 will wrap the text onto the line directly under the start of the text of the tag. So for example if the a tag is halfway along the line it will wrap to the next line but halfway along it inst...

Python float - str - float weirdness

>>> float(str(0.65000000000000002)) 0.65000000000000002 >>> float(str(0.47000000000000003)) 0.46999999999999997 ??? What is going on here and how do I convert 0.47000000000000003 to string and the resultant value back to float? I am using python 2.5.4 on windows. ...

Weird result printing pointers as float in C

I know this is wrong and gcc will give you a warning about it, but why does it work (i.e. the numbers are printed correctly, with some rounding difference)? int main() { float *f = (float*) malloc(sizeof(float)); *f = 123.456; printf("%f\n", *f); printf("%f\n", f); return 0; } Edit: Yes, I'm using gcc with a 32-bit mach...

Float not correct in MySQL

Hi, I am entering '35444650.00' as a float into my MySQL and it keeps reformatting to 35444648.00, any help welcome... ...

sIFR 3 no text wrap around floating images

Is sIFR supposed to wrap around floating images? I have some headings next to a large image float:left and the image bumps the headline down below it. Headings that aren't beside floating images do wrap properly so the functionality is there, so my question is whether or not sIFR 3 text wraps beside floating images. Jeremy ...

Centering float left div's in the body

hello guys! i have this piece of code <body> <? while.. (blah blah blah){ ?> <div class="product"> something </div> <? } ?> </body> and the css file is .product{ width:350px; float:left; } the problem is that body doesn´t have a width, well... actually it has, 90%, but my problem is on t...