It is currently March 29th, 2024, 8:30 am

Thousands to K

Get help with creating, editing & fixing problems with skins
Tomas
Posts: 5
Joined: August 11th, 2017, 8:52 pm

Thousands to K

Post by Tomas »

Hello im making myself live youtube subs/views counter
Image

And as you can see i have views in normal numbers but i want when they hit like in last example 6645 i want it to show 6.6k
and it go on and if it hit mil it would show 1.1m. :confused:
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Thousands to K

Post by SilverAzide »

Gadgets Wiki GitHub More Gadgets...
Tomas
Posts: 5
Joined: August 11th, 2017, 8:52 pm

Re: Thousands to K

Post by Tomas »

I saw this post but i still dont understand how to apply it
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thousands to K

Post by balala »

Tomas wrote:I saw this post but i still dont understand how to apply it
Sorry for the late reply, I read just now your question.
So, as SilverAzide said, you have to apply an AutoScale option. This option can be used on those String meters, which are returning those numeric values which have to be scaled. You have to find these String meters. Based on the posted image, these meters are those which show the last column (110, 197 and 6645). I can't say how those meters are named, you have to identify them. Most probably, but not absolutely necessary, they will be the third, sixth, ninth and so on (if there are more) string meters.
If you can't find them and you're still interested, please post the whole code of the skin.
Tomas
Posts: 5
Joined: August 11th, 2017, 8:52 pm

Re: Thousands to K

Post by Tomas »

balala wrote:Sorry for the late reply, I read just now your question.
So, as SilverAzide said, you have to apply an AutoScale option. This option can be used on those String meters, which are returning those numeric values which have to be scaled. You have to find these String meters. Based on the posted image, these meters are those which show the last column (110, 197 and 6645). I can't say how those meters are named, you have to identify them. Most probably, but not absolutely necessary, they will be the third, sixth, ninth and so on (if there are more) string meters.
If you can't find them and you're still interested, please post the whole code of the skin.
Sorry for a late reply too heres my code: its very messy tho

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Background=Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14

[BassVibes]
Measure=Plugin
Plugin=WebParser
URL=https://socialblade.com/youtube/channel/UCWIJaiu9tPLQXCS2dnumrvA
RegExp=(?siU)<div class="YouTubeUserTopInfo">.*<span id="youtube-stats-header-subs" style="display: none;">(.*)</span>
</div>
UpdateRate=300

[BassVibesViews]
Measure=Plugin
Plugin=WebParser
URL=https://socialblade.com/youtube/channel/UCWIJaiu9tPLQXCS2dnumrvA
RegExp=(?siU)<div class="YouTubeUserTopInfo">.*<span id="youtube-stats-header-views" style="display: none;">(.*)</span>
UpdateRate=300
[MemesKing]
Measure=Plugin
Plugin=WebParser
URL=https://socialblade.com/youtube/channel/UC4m-5KtEJtMQWu_NXgPxfww
RegExp=(?siU)<div class="YouTubeUserTopInfo">.*<span id="youtube-stats-header-Subs" style="display: none;">(.*)</span>
UpdateRate=300
</div>
[MemesKingViews]
Measure=Plugin
Plugin=WebParser
URL=https://socialblade.com/youtube/channel/UC4m-5KtEJtMQWu_NXgPxfww
RegExp=(?siU)<div class="YouTubeUserTopInfo">.*<span id="youtube-stats-header-views" style="display: none;">(.*)</span>
UpdateRate=50
[Measure_Memes_Views]
Measure=Plugin
Plugin=WebParser
URL=[MemesKingViews]
StringIndex=1

[Measure_Memes]
Measure=Plugin
Plugin=WebParser
URL=[MemesKing]
StringIndex=1
[DropTopViews]
Measure=Plugin
Plugin=WebParser
URL=https://socialblade.com/youtube/channel/UCkWb7HcZ2a45HdUjsYRfPHA
RegExp=(?siU)<div class="YouTubeUserTopInfo">.*<span id="youtube-stats-header-views" style="display: none;">(.*)</span>
</div>
UpdateRate=50

[Measure_Vibes_Views]
Measure=Plugin
Plugin=WebParser
URL=[BassVibesViews]
StringIndex=1

[Measure_Drop_Views]
Measure=Plugin
Plugin=WebParser
URL=[DropTopViews]
StringIndex=1

[Measure_Vibes]
Measure=Plugin
Plugin=WebParser
URL=[BassVibes]
StringIndex=1

[DropTop]
Measure=Plugin
Plugin=WebParser
URL=https://socialblade.com/youtube/channel/UCkWb7HcZ2a45HdUjsYRfPHA
RegExp=(?siU)<div class="YouTubeUserTopInfo">.*<span id="youtube-stats-header-subs" style="display: none;">(.*)</span>
</div>
UpdateRate=600

[Measure_Top]
Measure=Plugin
Plugin=WebParser
URL=[DropTop]
StringIndex=1

[Meter_SubsText]
Meter=String
X=76
Y=14
FontSize=8
FontFace=Trebuchet MS
FontColor=255,255,255,205
StringAlign=Left
AntiAlias=1
Text=Subscribers

[Meter_S]
Meter=String
X=160
Y=23
FontSize=6
FontFace=Trebuchet MS
FontColor=255,255,255,205
StringAlign=Center
AntiAlias=1
Text=S

[Meter_V]
Meter=String
X=186
Y=23
FontSize=6
FontFace=Trebuchet MS
FontColor=255,255,255,205
StringAlign=Center
AntiAlias=1
Text=V


[Meter_Subs]
Meter=String
MeasureName=Measure_Vibes
X=160
Y=40
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold

[Meter_Views]
Meter=String
MeasureName=Measure_Vibes_Views
X=186
Y=40
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold

[Meter_CN]
Meter=String
Text=Bass Vibes
X=15
Y=40
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Left
AntiAlias=1
StringStyle=Bold
LeftMouseUpAction=["https://www.youtube.com/channel/UCWIJaiu9tPLQXCS2dnumrvA"]
[styleSeperator]
SolidColor=255,255,255,15

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=58
W=190
H=1

[Meter_CN2]
Meter=String
Text=DROP TOP
X=15
Y=65
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Left
AntiAlias=1
StringStyle=Bold
LeftMouseUpAction=["https://www.youtube.com/channel/UCkWb7HcZ2a45HdUjsYRfPHA"]

[Meter_Subs2]
Meter=String
MeasureName=Measure_Top
X=160
Y=65
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold

[Meter_Views2]
Meter=String
MeasureName=Measure_Drop_Views
X=186
Y=65
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold

[meterSeperator2]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=83
W=190
H=1

; //StringEffect=SHADOW
; //FontEffectColor=0,0,0,255

[Meter_CN3]
Meter=String
Text=Memes King
X=15
Y=90
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Left
AntiAlias=1
StringStyle=Bold
LeftMouseUpAction=["https://www.youtube.com/channel/UC4m-5KtEJtMQWu_NXgPxfww"]
[Meter_Subs3]
Meter=String
MeasureName=Measure_Memes
X=160
Y=90
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold
[Meter_Views3]
Meter=String
MeasureName=Measure_Memes_Views
X=186
Y=90
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold
[meterSeperator3]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=108
W=190
H=1
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Thousands to K

Post by mak_kawa »

Insert AutoScale=2 line to appropriate string meters, possibly [Meter_Views], [Meter_Views2] and [Meter_Views3].
Tomas
Posts: 5
Joined: August 11th, 2017, 8:52 pm

Re: Thousands to K

Post by Tomas »

mak_kawa wrote:Insert AutoScale=2 line to appropriate string meters, possibly [Meter_Views], [Meter_Views2] and [Meter_Views3].
Tried put it everywhere still dont work :/
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Thousands to K

Post by eclectic-tech »

Tomas wrote:Tried put it everywhere still dont work :/
The issue is due to the fact that: When a meter is bound to a measure, it automatically uses the correct value for its type.
Your value is bound to a String meter and so uses the String value of the measure; you can not autoscale a string.

One way to display the string as an auto-scaled number, would be to add a Calc measure for each Webparser measure that returns a string "number". Then use that measure in your string meter.

Code: Select all

[Measure_Memes_Views]
Measure=Plugin
Plugin=WebParser
URL=[MemesKingViews]
StringIndex=1

[Measure_Memes_Views_Number]
Measure=Calc
Formula=Measure_Memes_Views

...

[Meter_Views3]
Meter=String
MeasureName=Measure_Memes_Views_Number
X=186
Y=90
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold
AutoScale=2

...
Another option (an possibly easier to do) would be to use a SectionVariable rather than a bound measure. To do this. do not use MeasureName=... in the meter; instead use

Code: Select all

[Meter_Views3]
Meter=String
;MeasureName=Measure_Memes_Views_Number
X=186
Y=90
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold
Text=[Measure_Memes_Views:/1000,1]
DynamicVariables=1

This will use the number value, scale it with 1 decimal, all in one step. Note you must add DynamicVariables=1 any time you use SectionVariables (more info here).

This would be how I would suggest to correct your issue.
Tomas
Posts: 5
Joined: August 11th, 2017, 8:52 pm

Re: Thousands to K

Post by Tomas »

eclectic-tech wrote:The issue is due to the fact that: When a meter is bound to a measure, it automatically uses the correct value for its type.
Your value is bound to a String meter and so uses the String value of the measure; you can not autoscale a string.

One way to display the string as an auto-scaled number, would be to add a Calc measure for each Webparser measure that returns a string "number". Then use that measure in your string meter.

Code: Select all

[Measure_Memes_Views]
Measure=Plugin
Plugin=WebParser
URL=[MemesKingViews]
StringIndex=1

[Measure_Memes_Views_Number]
Measure=Calc
Formula=Measure_Memes_Views

...

[Meter_Views3]
Meter=String
MeasureName=Measure_Memes_Views_Number
X=186
Y=90
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold
AutoScale=2

...
Another option (an possibly easier to do) would be to use a SectionVariable rather than a bound measure. To do this. do not use MeasureName=... in the meter; instead use

Code: Select all

[Meter_Views3]
Meter=String
;MeasureName=Measure_Memes_Views_Number
X=186
Y=90
FontColor=255,255,255,205
FontSize=8
FontFace=Trebuchet MS
StringAlign=Center
AntiAlias=1
StringStyle=Bold
Text=[Measure_Memes_Views:/1000,1]
DynamicVariables=1

This will use the number value, scale it with 1 decimal, all in one step. Note you must add DynamicVariables=1 any time you use SectionVariables (more info here).

This would be how I would suggest to correct your issue.
Thank you very mutch that formula thing worked perfect :)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Thousands to K

Post by eclectic-tech »

Glad to help! :welcome: