How to sort fractions in a column

I created a table and form to categorize router bits but when I entered the size they were not in numeric size order, is there a way to sort because sort ascending doesn’t work.

Might be just as easy to start over too, any help appreciated.

Hello,

Here I set the Size field to type Double in the table design. Then set the display type to Fraction (in table design or right mouse click wanted column):

Now you can sort:

image description

(Since there is/was a bug in Calc concerning fraction formatting.)
For a side-interset: Are numerator and denominator specified/expected to be of an integer type here? Is this exclusively a matter of Base or is there database software offering fractional types?
Does Base use the same concept of NumberFormat as LibreOffice in general? If so, what object is parent of the NumberFormats container? The Form? The parent of the Forms?

@Lupp,

Not certain I’ll be able to satisfy your questions.

Are numerator and denominator specified/expected to be of an integer type here?

Yes. Any non-integer here will result in a value of 0.

Is this exclusively a matter of Base or is there database software offering fractional types?

Types used can be Numeric, Double or Float. There is no type Fraction.

The remainder I’m kind of lost with. It seems the concept may be the same (my educated guess) but the parent eludes me and where to look.

@Lupp,

Here is link to data types available when using HSQLDB v1.8 embedded (included with LO and used in answer) → Data Types.

Another here → SQL Data Types for MySQL, SQL Server, and MS Access

Sorry! I messed up my intended question completely. Of course numerator and denominator need to be integer values due to how we define fractions, and the part in front of the fraction is called the intehger part anyway. (The integer part was mainly my concern, but I missed to mention it.) However, if these three numbers are assigned during calculation to variables of an integer type, it is doubtable in principle if these variables can take the results based on Double (e.g.) calculations, or if they may overflow. (This was he background of the mentioned bug which seems to be fixed meanwhile - in a sense.)
An example: If the three numbers are sent to 32-bit integers, 2^32+1/5 cannot be shown in # ?/? format, despite the fact that it is well represented with sufficient accuracy in Double.
Also:2^32/5 cannot be displayed in ?/? because the numerator will overflow.
This was the situation in Calc, and the “fix” was, to display a #FMT error insted of wrong numbers.

@Ratslinger: Thanks for the link!
forRatslingerConcerningFractionFormats.ods
See also tdf#137453

@Lupp,

Using your .ods file first line, entered 4294967296.2 in the database table and also got #FMT for a result.

4294967295.2 answered with 4294967295 1/5

@Ratslinger: Seems to be the same as in Calc though the dialog is different.
Did you also check (2^32-1000)/5 (that’s 858993259.2)?
Don’t worry anyway. The bugfix announced by @erAck works as expected in V71.0.0.beta1.

Thanks Ratslinger, when I did that when entering a fraction like 5/32 it drops everything but the fist number and when I first tried it changed fractions to a five digit number. What am I doing wrong?

I should have added that I deleted the original table and started over too.

@KAC352,

There is no way to tell from what you have posted. Don’t even know what field type or format you used. Did present steps in my answer - I set field type to double then display type (format) to Fraction. That’s all that is needed. Only thing that may help is for you to post a sample. Edit your question and post it there.

Not sure what I did before but started over and used your suggestion and it worked perfect
Thanks Ratslinger