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 04-15-2022, 05:17 PM   #1
annoywife
Member
annoywife began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2015
Device: none
Entering more than two decimal places in floating point column

I feel like I am missing something very basic here: I’ve added a custom column with Column Type “Floating point numbers”, but I can only enter a max of two decimal places via the GUI. However, when I write directly to the database via a plugin/script, the field is capable of holding many more (e.g. when setting the custom column to format {0:.13f}, I can see precision to 13 decimal places).

Is there any way for me to enter more than two decimal places manually via the GUI?
annoywife is offline   Reply With Quote
Old 04-15-2022, 11:48 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
13 is the whole number portion

13.3F would have 3 decimal places (and 9 whole digits)
theducks is offline   Reply With Quote
Old 04-16-2022, 01:23 AM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by theducks View Post
13 is the whole number portion

13.3F would have 3 decimal places (and 9 whole digits)
R U Sure ?

Click image for larger version

Name:	attachment.jpg
Views:	760
Size:	150.8 KB
ID:	193255

The Reading Ease value was calculated by Count Pages.

BR

Last edited by BetterRed; 04-16-2022 at 01:35 AM.
BetterRed is online now   Reply With Quote
Old 04-16-2022, 06:31 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by BetterRed View Post
R U Sure ?

Attachment 193255

The Reading Ease value was calculated by Count Pages.

BR
Nope!
that was what I use in a save template. I don't format columns very often.
theducks is offline   Reply With Quote
Old 04-16-2022, 07:26 AM   #5
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by annoywife View Post
I feel like I am missing something very basic here: I’ve added a custom column with Column Type “Floating point numbers”, but I can only enter a max of two decimal places via the GUI. However, when I write directly to the database via a plugin/script, the field is capable of holding many more (e.g. when setting the custom column to format {0:.13f}, I can see precision to 13 decimal places).

Is there any way for me to enter more than two decimal places manually via the GUI?
No. The float field GUI widgets are limited to 2 decimal places. You can probably get around this using the Action Chains plugin instead of the built-in GUI widgets to present an edit widget then store the result in the database.
Quote:
Originally Posted by theducks View Post
13 is the whole number portion

13.3F would have 3 decimal places (and 9 whole digits)
The formatter does what @theducks says. For example, this template
Code:
{:>13.3f:'300/2.1'}
produces 142.857.

Quote:
Originally Posted by BetterRed View Post
R U Sure ?
Attachment 193255

The Reading Ease value was calculated by Count Pages.

BR
You are mixing things. The format template is used when displaying the number. The 2-decimal-digit format is used in edit widgets. See the attachments.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	53
Size:	30.1 KB
ID:	193264  
Attached Images
  
chaley is offline   Reply With Quote
Old 04-16-2022, 09:28 AM   #6
annoywife
Member
annoywife began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jan 2015
Device: none
Got it! Formatting strings change how a number is displayed, but have no effect on the number's actual value or on how the GUI allows/requires entry (such as only allowing two decimal places) - this is determined by the configuration of each GUI widget in the Calibre code.

Thanks to everyone for your quick and helpful responses - very much appreciated!

annoywife is offline   Reply With Quote
Old 04-16-2022, 11:54 AM   #7
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
You can now specify the number of decimal digits allowed when editing a float in the custom column type editor.
Attached Thumbnails
Click image for larger version

Name:	Clipboard02.jpg
Views:	59
Size:	42.7 KB
ID:	193273  
chaley is offline   Reply With Quote
Old 04-16-2022, 12:25 PM   #8
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,974
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Just curious: Is there an option for unlimited numbers? Though I could see it causing issues, and I imagine an arbitrary high number like 99 would work just as well.
ownedbycats is offline   Reply With Quote
Old 04-16-2022, 12:26 PM   #9
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Just curious: Is there an option for unlimited numbers? Though I could see it causing issues, and I imagine an arbitrary high number like 99 would work just as well.
Nope. The range for decimals (digits after the decimal point) is 1 to 9.

Last edited by chaley; 04-16-2022 at 02:33 PM. Reason: Clarified
chaley is offline   Reply With Quote
Old 04-16-2022, 06:52 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
You can now specify the number of decimal digits allowed when editing a float in the custom column type editor.


BR
BetterRed is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre2opds: Custom Catalogs: How can I point to a custom column? LivresInOz Related Tools 7 03-31-2021 11:14 AM
Can’t get title sorting to work properly with series that has decimal places Rockstead Calibre 3 12-25-2020 09:49 AM
Decimal "Rating" column (Custom) and Stars Chris_Snow Library Management 6 04-06-2015 12:25 PM
Formatting Floating Point # Custom Column GeekyGal Library Management 3 06-03-2011 05:34 PM
Help with Search - Floating Point Number nynaevelan Library Management 16 04-13-2011 06:37 AM


All times are GMT -4. The time now is 08:18 PM.


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