SSRS How do i force number to two decimal numbers if it is not 0? - reporting-services

If the number has value force it to 0.00 format if it is 0 just display as 0 .
I have tried rounding (shows up as an error) and the text boxes are set to number and it still has a continuous number.
For example:
fields.day12.value = 0 display as 0 BUT if it is fields.day12.value = 12.45555555555 display as 12.45

Unless they are specified, the text boxes' FORMAT property will apply the same format regardless of how many digits are needed or the number is negative or zero.
To use different formatting for negative numbers or zero, the FORMAT property can be used with a custom number format that specifies the negative and zero formats.
+#,##0.0;-#,##0.0;0.0
The first part before the semicolon is for the positive values, the second for negative, and then zero.
For the format required, you could use
0.00;-0.00;0

Related

Making checkbox size bigger in MS Access

I am trying to increase the size of checkbox in MS Access and I know that the default checkbox size cannot be increased.
However, I tried to achieve this by creating an input box and following what is listed here:
http://allenbrowne.com/ser-52.html
I am confused about this step:
Hold down the Alt key, and type 0168 on the numeric keypad (the character for False)
Holding alt key and typing that does not give me a "X" in report view. It gives a very small question mark.
Can I no longer use the method described in the blog above to create a bigger checkbox?
Technique from that blog is simply setting format on a numeric value where character shown depends on whether number is positive or negative. First position is for positive number and second position is for negative. Since True is -1 in a Yes/No field, second position character will be displayed.
If Alt+ is too difficult or other symbols are preferred, another way to get special characters is to copy/paste from Windows Character Map utility.
Instead of using Wingdings font to display symbols, can show alpha characters by setting Format property of textbox with:
To show Y or N: \N;\Y
To show X or nothing: ;\X
Same result can be achieved with an IIf() conditional expression in textbox ControlSource or query calculated field. Difference is the calculated result is the alpha character whereas setting format property does not alter what is actually in the field/textbox.

access 2016 calculated fields round to zero

I am trying to include a simple density calculation in access 2016, but the form returns a value of 0 if the input dimensions (mass or sphere diameter) are < 0.5. The field works fine for larger dimensions, so I assume that the smaller values are getting rounded to 0 somewhere along the way, but I can't figure out where.
For the inputs in my table, I have Field Names "green mass", "green pole", and "green equator" where the data type for each is set to "number," the Field Size is set to "single" (vs. double or decimal), and the Decimal Places is set to 4 digits
The resulting density is displayed in the Field "apparent green density" where the data type is set to "calculated," the Result Type is set to "single" and the Decimal Places is set to 4 digits.
After looking at various access forums and websites, I'm pretty sure I want to use single or double as my field size, but I've also tried decimal and byte and integer I keep getting 0.
Can anyone explain why this isn't working?
The equation is below. It's a bit complicated because it's a 3-part If statement (if dimensions for a sphere are given, caclulate density of a sphere, if dimensions of a disc are give, calculate density of a disc, if dimensions of a cube...) All three cases work for large dimensions (>0.5), but all 3 result in 0 for dimensions <0.5.
IIf([GreenPole],[GreenMass]/(3.14159265359/6*2.54^3*(([GreenPole]+[GreenEquator])/2)^3),IIf([GreenDia],([GreenMass]/(3.14159265359*([GreenDia]/2)^2*[GreenHeight]*2.54^3)),IIf([GreenLength],[GreenMass]/([GreenLength]*[GreenWidth]*[GreenThickness]*2.54^3),0)))
The first part of the equation for density of a sphere, is:
`IIf([GreenPole],[GreenMass]/(3.14159265359/6*2.54^3*(([GreenPole]+[GreenEquator])/2)^3),0)
Oliver Jacot-Descombes got me started in the right direction. I don't have much experience at all with coding, but I think what happened is that field identified in my IIf statement is somehow transformed into a boolean or yes/ no field and anything less than 0.5 is rounded to a no and the result of the truepart is then 0.
I modified the code to:
IIf([GreenPole]>0,[GreenMass]/(3.14159265359/6*2.54^3*(([GreenPole]+[GreenEquator])/2)^3),0)
And everything works now. (I also modified the second and third IIf statments to IIf([GreenLength]>0 and IIF([GreenDia]>0..)

Formatting issue when using "Fixed" for decimal rounding

I have a report with total, max, min, avg, at the bottom of it. For some of the values they need to have a certain number of decimal places, and in some places they are supposed to have no decimal places. Whenever I set the number to "Fixed" and decimal places to "0" it seems to add space to the right of the number within the textbox. All of my fields are right-aligned so this moves them over to the left, in some cases pushing the numbers past the limits of the field.
Is there an easy way to fix this at all? Is this a known bug?
It can be due negative number format. Do you have negative number format configured to be shown after the number ( in control panel)?
For positive numbers, Windows displays a blank space.
Also, you can try to set the Format property to #.##0

Html rgba color opacity?

When we use RGBA in Html we use sth like this.
<div style="Background: rgba (x, x, x, 0.dd)">Some Content</div>
How many decimals can you go in the dd(opacity). Is it browser dependent? Or are its limits specified in HTML standards?
The specification says it is a <number> which is defined as:
zero or more digits followed by a dot (.) followed by one or more digits
So there is no limit specified in the CSS spec.
I'd be surprised if any human eye could distinguish beyond two decimal places though.
The value can be any number between 0.0 and 1.0.
The resolution depends on the color space resolution which typically is 8-bit (future may offer higher resolutions such as 10- and 12-bit, although I doubt that will happen anytime soon, but that is why a fraction is used instead of a byte value).
The value is multiplied with the byte value so it is limited what numbers you want to use and the final value is rounded to closest integer value:
Internal byte value = round(alpha * 255);
(or an increment of 1 / 256 = 0.00390625)
to give you actual change of the final byte value and the visual appearance (assuming solid background).
I made a small script here which gives you the result from using various numbers of decimals in the fraction value - as you can see when you are at 3 decimals the values start to be similar and therefor not so useful.
ONLINE GENERATED TABLES HERE
The loop to generate the table looks like this in general:
for (; i < 1; i += 0.1) {
num = Math.round(i * 255, 10);
...
}
The opacity property has a value set to two decimals.
All current browsers recognize this, the context is a little different for IE8 and below.

Percentages in SSRS Chart

EDIT: The chart is fixed when I use a stacked chart instead of a stacked percentage chart, but this still doesn't tell me what is wrong with using the percentage chart.
I have a stacked percentage chart which is going from 0 to 10000% instead of 0 to 100%. It appears as if the values are formatted correctly (they add up to 1.01 due to rounding), and even dividing all the values by 100 in the query does not change it.
This is how the chart renders:
with the following Vertical Axis Properties:
I have a table below (with identical number formatting but with 2 percentage points), however that displays as expected:
Finally, here is the raw data set with an additional sum column not reflected in SSRS:
Has anyone come across this issue before? If I manually set the range of the chart from 0-100% (0-1) I can only see that bottom blue series.
Yep. I've seen exactly this. The numbers that the percent chart axis generates are in the range 0 to 100. But when you apply the number formatting as a percent, then the numbers are multiplied by 100 for display.
The trick to fix/work around this is to set the display format to only add the percent sign, not really format the number as a percent. Happily, this requires just one character:
In the Number format for the axis, switch the Category to "Custom." If you just switched from Percentage, you will see something similar to 0%.
Insert a backslash before the percent symbol: 0\% to indicate that you need a literal percent symbol, not to format the number as a percent (multiplied by 100.)
Voila.