/*
 * ST_FXCONV.pgc - st 모듈 서비스 ST_FXCONV (one service = one file).
 * Moved verbatim from the former inline st_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by st_svr at tpsvrinit.
 */
#include "ST_FXCONV.h"

/* 28. ST_FXCONV - 외화 환산: fx * rate/100 = KRW. */
void ST_FXCONV(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    long fx = getl(b, T_FX_AMT), rate = getl(b, T_ARG1), krw;
    if (rate <= 0) rate = 1350;                /* 13.50 KRW/unit (bps of 100) */
    krw = fx * rate / 100;
    setl(b, T_AMOUNT, krw);
    OK(b);
}

/* vim: set ts=4 sw=4 et smartindent: */
