PDA

View Full Version : Numberfield fractions



Insanity
February 18th, 2013, 15:27
Was curious if it is possible to get a numberfield to display a fraction, vs a decimal?
Working on a ruleset where the number of attacks or the rate of fire for weapons can be 1 every 3 rounds, or 1/2, 1/3, 1/4, etc.. I would like the fraction to be shown rather then 0.3333333333.

Trenloe
February 18th, 2013, 15:37
I think you'll have to use a string field to be able to include non numeric characters.

Insanity
February 18th, 2013, 15:51
Figured that be the case. Alternatively, could make some indicator icons that click cycled through on a click to show what the current rate is.

Moon Wizard
February 19th, 2013, 09:32
I actually did that for a ruleset at one point to indicate .5x, 1x or 2x. I used small icons that were actually pictures of text that you cycled through.

Regards,
JPG

S Ferguson
February 26th, 2013, 17:12
Trenloe has a point. Fractions aren't native to FG. I've tried to implement fractions as non-decimals and the only way I was able to change this was by creating a string field, and parsing the numbers before and after the "/". Then the Lua code reverts it back to a decimal for internal use. It's really just a cosmetic change for the user, and a little bit of coding, but if you want it, this is one way of getting it done.


I do find, however it's easier to type 1/3 than .33....