|  07-02-2023, 05:04 PM | #1 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
				
				Rounding when copying ratings columns
			 
			
			When copying a custom #ratings with half-stars to rating (no way to set the tag browser tooltip to a custom column), does it always round down the half-stars?   | 
|   |   | 
|  07-02-2023, 05:28 PM | #2 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			½-star books round down to 0 and become undefineds, lol.
		 | 
|   |   | 
| Advert | |
|  | 
|  07-02-2023, 05:41 PM | #3 | 
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | 
			
			Yes, it uses // as the division operator, which returns the floor(). It then adds back the half star if appropriate.
		 | 
|   |   | 
|  07-02-2023, 10:54 PM | #4 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			To fix the ½-star issue: Code: program: if $$#ratings ==#'1' then '2' else $$#ratings fi | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| I love using column colours on a ratings column | ownedbycats | Library Management | 17 | 01-19-2022 06:32 PM | 
| Rounding Word Counts in a Custom Column | eosrose | Library Management | 0 | 05-18-2020 08:44 PM | 
| My Ratings column | MerlinMama | Calibre | 5 | 09-08-2016 07:20 AM | 
| Rounding to nearest integer in Custom Column - Hijri Year | oelgamal | Calibre | 2 | 03-28-2013 07:12 PM | 
| Rounding to nearest integer in Custom Column - Hijri Year | oelgamal | Recipes | 0 | 03-28-2013 02:58 AM |