fix(m02-df): 변환 흐름 화면 흠 넷 — 변수 예시값 · 표 찾기 실패 같은 뜻 · 다른 로직 서버 값 · 합계 끝수
- 변환: 설계 값 변수 예시값 = 줄 시험입력 · 없으면 check_master.시험입력 기본(글 수 → 수) · totalRound = null(옛 계는 끝수 없음) - Model CfLogic.totalRound(없음 = 기본 계금 1원 미만 버림 · null = 끝수 없음) · Round totalRoundFor · roundBy/roundText 가 null 받음 · Summary · M01 흐름 보기 합계가 그것을 씀 - Compute: 함수 결과 오류는 오류 값(「#N/A」 등)으로 넘김(화면 Eval 과 같음 · 받는 칸으로 번짐 · 옛 엔진은 그 줄을 비움) — 서버가 빈 칸 0 으로 계속 세던 차이 없앰 - 화면 값 물음(Entry_Detail queriesOf): 인력 · 기계 · 유가 조건 찾기도 자리 물음 · 재료 검색어 틀은 채운 글 · 다른 로직 입력은 서버 /logic-value 로 받은 설계 값째 셈(그 안 조건 찾기 · 단가까지) · Eval 은 서버 출력이 있으면 그것 - Values.one_value: 인력 · 기계 · 유가 자리 물음 = group_find - 전수 대조 시험입력 1,414/1,472(96.1%) · 기본 입력 1,429(97.1%) — 남은 49 는 sub4 범위규칙 칸 · 검색어 찾기 · 재료 값 차이 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VBToTCGk5dqDKeXCEP3vhk
This commit is contained in:
@@ -70,7 +70,8 @@ export async function defaultTotalRound(): Promise<CfRound> {
|
||||
}
|
||||
|
||||
/** 끝수 적용 — 소수 자리 · 방법(부동소수 오차는 아주 작은 값으로 눌러 줌) */
|
||||
export function roundBy(r: CfRound, v: number): number {
|
||||
export function roundBy(r: CfRound | null | undefined, v: number): number {
|
||||
if (!r) return v;
|
||||
const k = 10 ** r.places;
|
||||
const x = v * k;
|
||||
const eps = Math.abs(x) * 1e-12 + 1e-9;
|
||||
@@ -84,7 +85,8 @@ export function roundBy(r: CfRound, v: number): number {
|
||||
}
|
||||
|
||||
/** 「0.1원 미만 버림」 꼴 쉬운 말 */
|
||||
export function roundText(r: CfRound): string {
|
||||
export function roundText(r: CfRound | null): string {
|
||||
if (!r) return "끝수 없음(값 그대로)";
|
||||
const step = r.places > 0 ? Number((10 ** -r.places).toFixed(r.places)) : 1;
|
||||
return `${step}원 미만 ${r.method}`;
|
||||
}
|
||||
@@ -107,3 +109,7 @@ export function showRounded(v: number, r?: CfRound): string {
|
||||
let totalNow: CfRound = { places: 0, method: "버림" };
|
||||
void defaultTotalRound().then((r) => (totalNow = r));
|
||||
export const totalRoundNow = (): CfRound => totalNow;
|
||||
|
||||
/** 그 흐름의 합계 끝수 — 흐름에 정한 것(null = 끝수 없음) · 없으면 기본 */
|
||||
export const totalRoundFor = (lg: { totalRound?: CfRound | null }): CfRound | null =>
|
||||
lg.totalRound === undefined ? totalNow : lg.totalRound;
|
||||
|
||||
Reference in New Issue
Block a user