0
0

rex0220 計算式プラグインの使い方をGPTsに学習させてみる(その15)End of next month

Posted at

rex0220 計算式プラグインの使い方をGPTsに学習させてみる(その14)要件を箇条書きで指定の続きです。

翌月末の計算式を英語で問い合わせたところ、日本語で問合せた時とコードが違った。

概要

ボタンをクリックして、日付に当日の翌月末をセット の問合せをグーグル翻訳して、計算式を作ったら、生成されたコードに違いがあった。

2023-11-21_15h58_00.png

End of next month

.js
BUTTON(
    "End of Next Month",  // Button name
    FSET(DateField, 
         LET(
             today, TODAY(),  // Get current date
             nextMonth, DATE_ADD(today, 1, "month"),  // Add one month
             endOfNextMonth, DATE_ENDOF(nextMonth, "month"),  // Get last day of next month
             endOfNextMonth  // Set this as the result
         )
    )
)

Calculation formula that sets the date to the end of the next month of the current day by clicking a button
・Display button in space item
・Button name is set at the end of the next month
・Click the button to set the date to the end of the following month.
・Do not display dialog
・Use the LET function to calculate the end of the next month for the current day.

2023-11-21_15h51_50.png

コードの比較

英語で生成するコードと日本語で生成するコードが異なる。

  • 英語版: FSET の中の、LET 関数で翌月末計算
  • 日本語版: LET 関数で、翌月計算後に、FSET でセット

2023-11-21_16h04_18.png

まとめ

言語によって、生成するコードが異なる。
日本語の問合せでも、ちょっとした言い方の違いでコードが変わるくらいなので、翻訳した内容では解釈が変わってしまうのかもしれません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0