It is currently May 1st, 2024, 1:04 pm

Fractional Parts

Get help with creating, editing & fixing problems with skins
NewWave
Posts: 23
Joined: April 15th, 2012, 5:39 am

Fractional Parts

Post by NewWave »

Hello :welcome:

Under the [Rainmeter] section, does 'Update' make use of a number with a fractional part?
For measures/meters, does 'AverageSize' and 'UpdateDivider' make use of a number with a fractional part?

Generally, at what point is a given number rounded?
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fractional Parts

Post by Brian »

NewWave wrote:Under the [Rainmeter] section, does 'Update' make use of a number with a fractional part?
For measures/meters, does 'AverageSize' and 'UpdateDivider' make use of a number with a fractional part?
Nope, these options should be integers. The fractional part is just stripped off without rounding.
NewWave wrote:Generally, at what point is a given number rounded?
For the values that do not require an integer, I believe it is 5 decimal places before rounding.

-Brian
NewWave
Posts: 23
Joined: April 15th, 2012, 5:39 am

Re: Fractional Parts

Post by NewWave »

Thanks a bunch. :)
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fractional Parts

Post by jsmorley »

Might be a few more.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureCalc]
Measure=Calc
Formula=PI

[Meter1]
Meter=String
MeasureName=MeasureCalc
FontSize=13
FontColor=255,255,255,255
NumOfDecimals=16
That returns a valid fractional number up to 16 places. If I make it 17 or more, it just returns zeros after 16 places.

However, this returns only 5 decimal places...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureCalc]
Measure=Calc
Formula=PI

[Meter1]
Meter=String
FontSize=13
FontColor=255,255,255,255
Text=[MeasureCalc]
NumOfDecimals=16
DynamicVariables=1
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fractional Parts

Post by Brian »

Ah, I see.

I tried something similar, but I didn't utilize the NumOfDecimals option.

In the About Dialog, the measure with Formula=PI only shows 5 decimal places, but I guess that is the dialog itself rounding the value, not the actual measure.

-Brian
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fractional Parts

Post by jsmorley »

Brian wrote:Ah, I see.

I tried something similar, but I didn't utilize the NumOfDecimals option.

In the About Dialog, the measure with Formula=PI only shows 5 decimal places, but I guess that is the dialog itself rounding the value, not the actual measure.

-Brian
Looks to me that unless you are using a Rainmeter skin to help with the construction of your nuclear particle accelerator or with your human DNA sequencing work, it's best to consider that Rainmeter does stuff to 5 decimal places...
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Fractional Parts

Post by smurfier »

The String return of the measure returns up to five decimal points.

The Number return returns up to 16 decimal points. However, sometimes a seventeen decimal is returned that is incorrect.

For example, 1/3 returns 0.33333333333333331
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .