---
id: post/nataliekarolak-com/3648
type: post
title: Small AL quiz
summary: A quiz about AL code demonstrates how StrSubstNo formats decimal numbers with thousands separators in some regions, causing runtime errors in CalcDate date formulas. The post shows how to avoid this by using integers instead of decimals.
tier: community
language: en
tags:
  - al programming
  - calcdate
  - strsubstno
  - date formulas
  - formatting
  - region settings
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-25T18:23:14.357Z"
  flags: []
generated:
  at: "2026-10-25T18:17:26.277Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 2e14fcd8b4a010853868ed31b021cc5d0080a005224c48faf41b5278404b6d03
evidence:
  - kind: blog
    url: https://nataliekarolak.wordpress.com/2025/11/13/small-al-quiz/
    title: Small AL quiz
    date: "2025-11-13"
    commit: null
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "3648"
source_id: nataliekarolak-com
source_name: The BC Docs Librarian
url: https://nataliekarolak.wordpress.com/2025/11/13/small-al-quiz/
published_at: "2025-11-13T14:55:08.000Z"
author: Natalie Karolak
full_text: false
words: 259
quotes: []
code_objects_mentioned:
  - other CalcDate
  - other StrSubstNo
  - other Round
  - other Format
systems:
  - development
versions_mentioned: []
cautions:
  - kind: gotcha
    quote: Depending on your BC Region setting, formatted decimals receive a thousands separator
    objects: []
    events: []
    versions: []
preview:
  embeddable: true
  frame_url: https://nataliekarolak.wordpress.com/2025/11/13/small-al-quiz/embed/
  image: https://nataliekarolak.wordpress.com/wp-content/uploads/2025/11/questionmark.jpg
  image_alt: null
  image_w: 736
  image_h: 491
  site_name: The BC Docs Librarian
  favicon: https://nataliekarolak.wordpress.com/wp-content/uploads/2022/11/cropped-logo-216x216-1.png?w=32
  probed_at: "2026-10-25T18:21:55.773Z"
---

# Small AL quiz

[Read the post](https://nataliekarolak.wordpress.com/2025/11/13/small-al-quiz/) · The BC Docs Librarian (Natalie Karolak, MVP) · 2025-11-13 · 259 words · tier community · reviewed (checked by Opus)

> A quiz about AL code demonstrates how StrSubstNo formats decimal numbers with thousands separators in some regions, causing runtime errors in CalcDate date formulas. The post shows how to avoid this by using integers instead of decimals.

## Key points

- StrSubstNo formats decimal numbers using Format(Number, 0), which adds thousands separators based on region settings
- CalcDate requires date formulas without separators, so formatted decimals like '1,000D' cause runtime errors
- Using integers instead of decimals avoids the thousands separator issue
- Region settings affect how numbers are formatted in AL code

## AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

- other "CalcDate"
- other "StrSubstNo"
- other "Round"
- other "Format"

## Heads up

- gotcha: "Depending on your BC Region setting, formatted decimals receive a thousands separator"

## Context

- Features: CalcDate function, StrSubstNo function, number formatting, date formulas, region-specific formatting

Source: The BC Docs Librarian, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
