This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function formatNumber(fmt: string, value: number) { | |
// special case for `#,##0.0###` | |
// warning! you can't use `,` as a decimal delimiter in that particular case | |
// also, you can use up to 8 decimal places here | |
if (fmt[fmt.length - 1] === "#") { | |
const dotPos = fmt.lastIndexOf(".") | |
if (dotPos > -1) { | |
// fractional part | |
// -0.345; toFixed() is used to get rid of 0.9994999999180436 that is formatted using 0.0## into 0.999 which is wrong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ever wanted webix segmented button to have a few segments of fixed width AND a button that fills remaining space? | |
* Here comes this custom template. It can also be modified to split "remaining space" into segments with equal width. | |
*/ | |
function segmentedFillWidth (obj, common) { | |
var origOpts = common.config.options | |
var opts = origOpts.slice() | |
function hasWidth (v) { return !!v.width } | |
function hasNoWidth (v) { return !v.width } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This script for http://autohotkey.com will constantly press | |
; the middle mouse button to change CS:GO clan tag 6 times per second | |
; (the script is active only when CS:GO is running) | |
; you can change the button to whatever you don't use in the game, eg. F12 | |
; in that case update user.cfg accordingly | |
; | |
; Groups to join: | |
; http://steamcommunity.com/groups/loading001 | |
; http://steamcommunity.com/groups/loading002 | |
; http://steamcommunity.com/groups/loading003 |