Semantic UI star rating decimal - semantic-ui

I am using semantic rating but it only works for integer values. Is there any way which allows us to rate in decimal values.
For example, if the score is 10 out of 100 then only half star should be filled.

Related

In CSS, is there a way to format floating point numbers to a specific number of digits to the right of the decimal point?

I am trying to determine if, using just CSS, there is there a way to format floating point numbers to a specific number of digits to the right of the decimal point?
The reason I want to do this is that I need to use a website that displays a massive amount of continually updating data in tables. (Because the data is continually updating, I can't just export the data into a spreadsheet.)
The values are floating point and range from 0 to 9999. The number of fractional digits varies from 0 to 7. For the most part, I have no use for anything beyond hundredths (2 places to the right of the decimal point). The exception is for values ranging from 0 to 9, but I'm willing to forego that case, if necessary.
This is an tiny example of how the data is currently displayed:
9484.83
133.57643
1344.5432
9.5848274
58.48381
5989.1
1.5847493
1.348
As you can see, it's hard to read the data with that presentation. Ideally, I would like to use a CSS overlay to reformat that data as:
9484.83
133.57
1344.54
9.584
58.48
5989.10
1.584
1.348
If that's not possible, I'm fine with:
9484.83
133.57
1344.54
9.58
58.48
5989.10
1.58
1.34
Using CSS, I can easily enforce a maximum width for the HTML elements displaying the values. I can use em units to try to not get any digits partially displayed (not 100% effective though, unless forcing a monospaced font, which results in much less visible data in the viewport). But even using such techniques, I still wind up with values displayed as 58.4848.
Can CSS be used to solve this task?

HX711 and weight cell, throws large negative value

I have successfully installed 3 weight cells to Particle Photon, using HX711. The fourth weight cell shows large negative values e.g.-69798 when a certain amount of weight is added. The weight cell should be able to measure up to 10kg, as do the other three weight cells.
Is there a possible explanation for this outcome? When lowering the weight (on all four weight cells), which are connected to a single plate, the values look good. When adding about 3-4kg on the plate, the three weight cells shows good values while the fourth shows large negative values.
Simple solution. Just turn the load cell by 180 degree in vertical axis. Sometimes the manufacturer puts the sticker other way around.
This should solve.

SSRS Conditional Expression, Change Background Color

Working with a map in SSRS and I need a conditional statement that will change the background color for the three counties with the highest client count.
Keep in mind that these totals vary across 39 counties, 10 different races and date span of 12 months. The values fluctuate from one race to another. For example, Hispanic Native Americans = 350 for the entire state compared to White's total over 1,000,000 across the state.
Thanks

Star / half star rating function without if/then logic?

The question is, is there a straightforward mechanistic way to know which stars (gold, 1/2 gold, grey) to draw without using conditional logic, for example using a pointer to the correct star based on the result of a simple math function to generate star ratings in a five star display.
The point of this question is not Ratings Systems, but graphic display
I have a rating value of 0-100, floating point.
For example, in pseudocode:
bitmap1="http://myserver.com/goldstar.png"
bitmap2="http://myserver.com/halfstar.png"
bitmap3="http://myserver.com/greystar.png"
rating=89.003
possible=100
quantized=int(rating/possible)
imagearray=[bitmap1,bitmap2,bitmap3]
for i=0 to 4
selector=<compute which star to draw based on available data>
drawstars(25*i,100,imagearray[selector])
end for
Hopefully that will give you an idea of what i'm trying to do.
Think of the display as a scale, but in integers, so work in half stars. For example, if we have 5 stars, and can display half stars, our real scale is from 0 to 10. So, what we need to do is divide the original scale (0 to 100) down to give us 0 to 10. Then we do integer division by 2. The quotient of that will give us the number of complete stars to draw, and the remainder the number (0 or 1) of half stars to draw.
You may want to do some rounding first though -- otherwise, a rating of 5 stars will be essentially impossible to get (e.g., even an input score of 99 will still only give 4.5 stars).
Hm, if I were to take a stab at it...
In the for loop, go from i=1 to 5.
if (rating > i*20){ draw a gold star }
else{
if (rating > (i-1)*20 +10) {draw a half star }
else {draw a grey star}
}
This of course would give you the floor rating

Optimize zipcode distance calculation

Here is the question I have for all
I already have an existing system that does the "Near By Zipcodes" search.
The purpose of this post is to see if I can optimize the process.
Currently, I have about 43k zipcode records.
The way my current algorithm works is I select 1 record and do a full table scan of 43k records.
Is there a way to only take a subset (lat range, long range) and do the calculation that way?
You can get lat/lon for the centroids of all the zip codes from google, or geocoder.us (or wherever you get your geo data). Use them in your where clause as a rough guide to narrow your search.
What I usually do is bracket my searches plus and minus one degree. As mentioned, degrees latitude are about 69 miles. With longitude, things get a little more complicated. The closer you get to the North pole, the shorter the distance will be from one degree of longitude to another. For instance, at the Florida / Georgia border, one degree of longitude is about 55 miles apart, but at the California / Oregon border, it's only about 50 miles apart.
You first need to have the latitude / longitude for your starting location and probably want to set 4 variables such as: beglat, endlat, beglong and endlong. Assign the beglat to the starting location's latitude minus one degree, the endlat to the starting location's latitude plus one degree, etc. For a tighter search radius, you can choose half a degree or something else.

Resources