Hello im making myself live youtube subs/views counter
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.
It is currently April 23rd, 2024, 6:33 am
Thousands to K
-
- Posts: 5
- Joined: August 11th, 2017, 8:52 pm
-
- Rainmeter Sage
- Posts: 2604
- Joined: March 23rd, 2015, 5:26 pm
-
- Posts: 5
- Joined: August 11th, 2017, 8:52 pm
Re: Thousands to K
I saw this post but i still dont understand how to apply it
-
- Rainmeter Sage
- Posts: 16162
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Thousands to K
Sorry for the late reply, I read just now your question.Tomas wrote:I saw this post but i still dont understand how to apply it
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.
-
- Posts: 5
- Joined: August 11th, 2017, 8:52 pm
Re: Thousands to K
Sorry for a late reply too heres my code: its very messy thobalala 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.
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
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Thousands to K
Insert AutoScale=2 line to appropriate string meters, possibly [Meter_Views], [Meter_Views2] and [Meter_Views3].
-
- Posts: 5
- Joined: August 11th, 2017, 8:52 pm
Re: Thousands to K
Tried put it everywhere still dont work :/mak_kawa wrote:Insert AutoScale=2 line to appropriate string meters, possibly [Meter_Views], [Meter_Views2] and [Meter_Views3].
-
- Rainmeter Sage
- Posts: 5406
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Thousands to K
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.Tomas wrote:Tried put it everywhere still dont work :/
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
...
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 would be how I would suggest to correct your issue.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 5
- Joined: August 11th, 2017, 8:52 pm
Re: Thousands to K
Thank you very mutch that formula thing worked perfecteclectic-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.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 useCode: 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 ...
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).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 would be how I would suggest to correct your issue.
-
- Rainmeter Sage
- Posts: 5406
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Thousands to K
Glad to help!
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::