Created
May 23, 2020 02:14
-
-
Save brito/0b9bc483452be8ff9f17b36d3ccf59d3 to your computer and use it in GitHub Desktop.
Simple ASCII slider visualization of two quantities and their relative ratio
This file contains hidden or 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
/* | |
Simple ASCII slider visualization of two quantities and their relative ratio | |
eg */ select * from _slider(3,5); /* | |
*/ | |
create function _slider(_left int, _right int, _glyphs text[] = '{-,|,-}') | |
returns text as $$ | |
select | |
repeat(_glyphs[1], _left) | |
|| _glyphs[2] || | |
repeat(_glyphs[3], _right) | |
$$ language sql immutable; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment