Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 05-28-2021, 10:19 PM   #1
Phil_C
Addict
Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.
 
Phil_C's Avatar
 
Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
Can't get half-stars using rating_to_stars function

My plugboard places various items at the beginning of the Comments in the Details on a Kobo Clara.

The part of the template I'm having trouble with is this:

{#gr1:rating_to_stars(value,1)|<div>Rating: |</div><hr/>}

No half-stars show up, only whole stars. The rating comes from a custom column of floating point numbers. The ratings are from Goodreads and show up in the format x.xx in the custom column.

I must have something wrong, but I'm baffled, so I hope someone here can help. Thanks!
Phil_C is offline   Reply With Quote
Old 05-29-2021, 05:02 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Phil_C View Post
{#gr1:rating_to_stars(value,1)|<div>Rating: |</div><hr/>}
The word "value" shouldn't be there. In Single Function Mode the value is passed automatically.

EDIT: Just in case the above isn't clear, what you want is
Code:
{#gr1:rating_to_stars(1)|<div>Rating: |</div><hr/>}

Last edited by chaley; 05-29-2021 at 05:07 AM.
chaley is offline   Reply With Quote
Advert
Old 05-29-2021, 11:16 AM   #3
Phil_C
Addict
Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.
 
Phil_C's Avatar
 
Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
I tried that during previous experimenting. Just tried again to make sure, but it is still not working. Here is the entire plugboard:

Code:
kepub:KOBOTOUCHEXTENDED = ([{#pg_ct:|<div>Pages: |; }{#wd_ct:|Words: |; }{pubdate:|Published: |</div>}{#last_read:|<div>Last Read: |</div>}{#gr1:rating_to_stars(1)|<div>Rating: |  }{#gr1:| |</div><hr/>}{comments}] -> comments)
I added the numerical value from the same column so you can see the rating of 3.88 in the image. Only 3 stars show, where I assume it should be 3.5 stars.
Attached Thumbnails
Click image for larger version

Name:	IMG_4236.JPG
Views:	111
Size:	171.8 KB
ID:	187393  
Phil_C is offline   Reply With Quote
Old 05-29-2021, 11:38 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The function works. See this screen capture of the template being evaluated by the template tester.
Click image for larger version

Name:	Clipboard01.png
Views:	92
Size:	17.9 KB
ID:	187394

My guesses are:
  • the book wasn't updated on the Kobo so you are seeing the old value. Edit: Clearly not the case since we are seeing the 3.88. Sorry about the noise.
  • the Kobo cannot display the 1/2 star character. What happens if you paste the 1/2 star character (⯨) (the character shows as a box on Windows Chrome) into the template like this (an image so the half-stars show)?
    Click image for larger version

Name:	Clipboard02.png
Views:	93
Size:	3.1 KB
ID:	187395
Edit2: here is a link to the unicode page for half-star.

Last edited by chaley; 05-29-2021 at 11:41 AM.
chaley is offline   Reply With Quote
Old 05-29-2021, 01:09 PM   #5
Phil_C
Addict
Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.Phil_C ought to be getting tired of karma fortunes by now.
 
Phil_C's Avatar
 
Posts: 274
Karma: 391602
Join Date: Oct 2009
Location: Chicago, IL USA
Device: Sony PRS-350; Kobo Clara HD; Kobo Clara 2E; Kobo Clara BW
Your guess is correct. The Kobo Clara HD cannot display the half-star. I added the code for a half-star and a full star to the template, updated the Kobo, and got a blank space where the half-star should be, followed by a full star.

So I will just stick with the numerical rating, which of course is more accurate anyway.

The best thing that came out of this is the Template Tester -- which I had no idea existed (and does prove the star function works).

Thanks for your help.
Phil_C is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura Half the screen is working, half is not Txuricata Kobo Reader 4 02-12-2018 02:41 PM
Screen half-broken, reading from other half Freet Sony Reader Dev Corner 1 07-31-2013 06:52 AM
Stars oldyellr Feedback 23 10-01-2012 01:49 AM
Harvard creates cyborg flesh that’s half man, half machine xg4bx Lounge 1 09-02-2012 09:58 PM
half of my screen is blank and the other half is stuck in the USB condition. modsoul Sony Reader 1 11-04-2007 10:03 AM


All times are GMT -4. The time now is 02:53 AM.


MobileRead.com is a privately owned, operated and funded community.