> 
> (Sez who?)
> On 21/08/13 at 09:30pm, Adrian C. wrote:
> > On Wed, 21 Aug 2013, Dean Thomson wrote:
> > 
> > > So currently I'm looking at 19.625 C
> > 
> > So content of a tempN file is divided by 1000. 
> > 
> > > Is there a way to round off the output?
> > 
> > Use a format function that returns args[1] given as argument to 
> > math.floor or math.ceil.
> > 
> > Check README, 'uptimewidget' is the simplest example of a format 
> > function.
> > 
> > 
> > -- 
> > Adrian C. (anrxc) | anrxc..sysphere.org | PGP ID: D20A0618
> > PGP FP: 02A5 628A D8EE 2A93 996E  929F D5CB 31B7 D20A 0618
> 
> I've been hunting down how to round off the degrees as it was for example 
> (21.345c) thanks to the joys of k10temp on AMD.
> But to be honest I've been struggling trying to figure it out.
> 
> I don't feel overly confident in LUA to figure out math.floor or this other 
> function math.ceil.
> 
> Regarding the uptimewidget example.  I'm guessing it is this one.
> 
>  uptimewidget = widget({ type = "textbox" })
>   vicious.register(uptimewidget, vicious.widgets.uptime,
>     function (widget, args)
>       return string.format("Uptime: %2dd %02d:%02d ", args[1], args[2], 
> args[3])
>     end, 61)
> 
> 
> I can't quite figure out how to adapt math.floor and the thermal widget with 
> this.
> 
>  tempwidget = wibox.widget.textbox()
>  vicious.register(tempwidget, vicious.widgets.thermal,
>     function (widget, args)
>       return string.format(" - $1 C", 5, { 
> "../../module/k10temp/drivers/pci:k10temp/0000:00:18.3", "core", 
> "temp1_input", args[1]})
>     end, 61)
> 
> I know this is incorrect, but I'm still not sure how to properly do this.
> 
> Regards,
> Dean
> 
> 
>

I also tried the following but it just outputted "$1 C"  so I'm really not sure.

coretempwidget = wibox.widget.textbox()
 vicious.register(coretempwidget, vicious.widgets.thermal,
    function (widget, args)
      return string.format(" $1 C", math.floor(args[1] + 0.5))
     end,
     19,
     {"../../module/k10temp/drivers/pci:k10temp/0000:00:18.3", "core", 
"temp1_input"})

Dean
 

-- 
To unsubscribe, send mail to [email protected].

Reply via email to