Skip to content

Instantly share code, notes, and snippets.

View adityadees's full-sized avatar
🏠
Work From Home

Aditya Dharmawan Saputra adityadees

🏠
Work From Home
  • indonesia
  • 04:17 (UTC +07:00)
View GitHub Profile
@adityadees
adityadees / addDecimal.js
Last active June 4, 2021 03:06
JS Input format currecy
function addCommas(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
@adityadees
adityadees / fnStripTags.sql
Last active May 9, 2021 19:55
MSYQL FUNCITON REMOVE HTML TAGS FROM RECORD AND SELECT WITH LIMIT
SET GLOBAL log_bin_trust_function_creators=1;
DROP FUNCTION IF EXISTS funcStripTags;
DELIMITER |
CREATE FUNCTION fnStripTags( Dirty varchar(4000) )
RETURNS varchar(4000)
DETERMINISTIC
BEGIN
DECLARE iStart, iEnd, iLength int;
WHILE Locate( '<', Dirty ) > 0 And Locate( '>', Dirty, Locate( '<', Dirty )) > 0 DO
BEGIN