feat: acquire-core full legacy C corpus (~2066 files, build-verified) + generator + inventory
This commit is contained in:
commit
b96cf702ee
2897 changed files with 264970 additions and 0 deletions
37
app/common/st_cu_0006.c
Normal file
37
app/common/st_cu_0006.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/* @tier easy @module st @transform settlement-util */
|
||||
/*
|
||||
* st_cu_0006.c - 정산수수료 공통 유틸리티 (plain C) [tier=easy]
|
||||
*/
|
||||
#include "st_cu_0006.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* 수수료 계산: rate_bp 는 basis point(1bp=0.01%) */
|
||||
long st_cu_0006_fee(long amount, int rate_bp)
|
||||
{
|
||||
long fee;
|
||||
if (amount <= 0 || rate_bp < 0)
|
||||
return 0;
|
||||
fee = (amount * (long)rate_bp) / 10000L;
|
||||
if (fee < 0)
|
||||
fee = 0;
|
||||
return fee;
|
||||
}
|
||||
|
||||
/* 절사(내림) 단위 정규화 */
|
||||
long st_cu_0006_round_unit(long amount, long unit)
|
||||
{
|
||||
if (unit <= 0)
|
||||
return amount;
|
||||
return (amount / unit) * unit;
|
||||
}
|
||||
|
||||
/* 금액 구간 분류: 0=소액 1=일반 2=고액 */
|
||||
int st_cu_0006_classify(long amount)
|
||||
{
|
||||
if (amount < 10000L)
|
||||
return 0;
|
||||
if (amount < 1000000L)
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
Reference in a new issue