![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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) |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
My guesses are:
Last edited by chaley; 05-29-2021 at 11:41 AM. |
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 ![]() Thanks for your help. |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
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 |